Open benhutton opened 7 years ago
And actually, it looks like, if you add in any attributes, you lose option 4, and so option 2 is the only valid one:
> Redcarpet::Markdown.new(Redcarpet::Render::HTML).render(%(<hr class="screen-width">))
=> "<p><hr class=\"screen-width\"></p>\n"
> Redcarpet::Markdown.new(Redcarpet::Render::HTML).render(%(<hr class="screen-width"></hr>))
=> "<hr class=\"screen-width\"></hr>\n"
> Redcarpet::Markdown.new(Redcarpet::Render::HTML).render(%(<hr class="screen-width" />))
=> "<p><hr class=\"screen-width\" /></p>\n"
> Redcarpet::Markdown.new(Redcarpet::Render::HTML).render(%(<hr class="screen-width"/>))
=> "<p><hr class=\"screen-width\"/></p>\n"
And unfortunately, that is invalid html5:
<!DOCTYPE html>
<html>
<head><title>Test</title></head>
<body>
<hr></hr>
</body>
</html>
Run that through https://validator.w3.org/#validate_by_input
i was looking through the documentation for quite a while now because i would like to render the markdown without any <p>
wrapper tags, or have it render a different wrapper tag, or at least allow me to add a css class to that wrapper. it's kind of weird that i dont find anything related, sounds like a very basic thing.
@benhutton @phoet did either of you get anywhere with this? Also trying to render without <p>
.
nopse, i think ended up using a combination of a wrapper div and multiple css classes.
no, unfortunately
The second and fourth examples above work as I would expect. The first and third do not. Best I can tell, they are also valid ways to write an
hr
tag: http://www.w3schools.com/tags/tag_hr.aspThe first (
<hr>
) is the proper way to write it in html5 (https://www.w3.org/TR/html5/grouping-content.html#the-hr-element).