-
Notifications
You must be signed in to change notification settings - Fork 526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recognize HTML5 Block-Level Elements #331
Conversation
Please add a test for that feature. I suggest you add this known issue with 4-spaces-indented image: <section>
<img src="http://example.org/image.jpg" alt="">
</section> |
Because I know how much fun it can be to write tests ... 😆 Possibly another test: <figure>
<img src="http://example.org/image.jpg" alt="">
<figcaption>
<p>Hello world!</p>
</figcaption>
</figure> ... as it's probably just as common, in HTML5, to wrap images in IMHO, a real-world <section>
<header>
<hgroup>
<h1>Section heading</h1>
<h2>Subhead</h2>
</hgroup>
</header>
<figure>
<img src="http://example.org/image.jpg" alt="">
<figcaption>
<p>Hello world!</p>
</figucaption>
</figure>
<p>The quick brown fox <a href="http://en.wikipedia.org/wiki/The_quick_brown_fox_jumps_over_the_lazy_dog">jumps over the lazy dog.</a></p>
</section> Another test: <article>
<h1>Hello world!</h1>
<figure>
<img src="http://example.org/image.jpg" alt="">
<figcaption>
<p>Hello world!</p>
</figucaption>
</figure>
<p>Could be summary text that goes here.</p>
</article> Another thing to note, just in terms of docs perhaps, is that HTML5 changed the "distinction" of the term "block":
— MDN Not sure if that's of any interest to anyone. Edit:I've found these pages helpful for when it comes to eyeballing all of the latest/greatest HTML5 tags: Not sure if that would be of help here ... Having quickly glanced at the Let me know if you need some more help thinking of tests. |
I will try to have a look soon guys ; sorry for the delay and thanks for the patch! Merry Christmas too! 🎄 |
Ok, so this looks good to me. Just a couple of things:
Thank you guys! |
@silverhammermba : Any chance to address the feedback please ? :-) |
@robin850 I'm trying to throw in some tests, but now I can't get it to recognize HTML5 blocks using my patch. Granted I haven't touched redcarpet in a while, but I guess I must be building it wrong. |
@silverhammermba : Based on current master, if I run:
It works perfectly. If you have problem running tests, be sure to prefix |
Yeah, forgot to use bundle. I added a test which definitely works, but for some reason |
@silverhammermba : Thank you very much ! Could you please remove the Also, in general we should not alter the conformance suite as this is the original Markdown specs. Could you move these tests at the Ruby level please ? I guess you don't have to keep the whole files but if you really want, you can put them under the |
I have made the requested changes. |
Recognize HTML5 Block-Level Elements
Thanks for your patch and your patience @silverhammermba ! ❤️ 💙 💛 💜 💚 |
I regenerated html_blocks.h using gperf. Also, I added the source file for gperf so that it's easier to regenerate in the future if the block-level elements are change.