1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:07:46 +00:00

LibMarkdown: Match HTML formatting of Commonmark tests

This patch changes the HTML formatting (where to put newlines, etc...)
to better match commonmark's test cases. This has minimal effect of the
correctness of our markdown implementation, but makes it easier to test.

Changes:
 - Use <em> instead of <i>.
 - Newline before end of code block.
 - <hr /> instead of <hr>.
 - Newline before first list item.
 - Newline between lines of a paragraph.
 - Trim whitespace on lines of paragraphs.

 Tests passed: 33/652 -> 87/652
This commit is contained in:
Peter Elliott 2021-08-29 15:59:41 -07:00 committed by Andreas Kling
parent 8d2c04821f
commit dee84113ab
5 changed files with 8 additions and 8 deletions

View file

@ -36,7 +36,7 @@ String CodeBlock::render_to_html() const
if (style.strong)
builder.append("<b>");
if (style.emph)
builder.append("<i>");
builder.append("<em>");
if (style_language.is_empty())
builder.append("<code>");
@ -48,10 +48,10 @@ String CodeBlock::render_to_html() const
else
builder.append(escape_html_entities(m_code));
builder.append("</code>");
builder.append("\n</code>");
if (style.emph)
builder.append("</i>");
builder.append("</em>");
if (style.strong)
builder.append("</b>");