mirror of
https://github.com/RGBCube/serenity
synced 2025-05-18 18:45:08 +00:00
LibMarkdown: Avoid emitting <pre> tags for now, to help LibHTML
LibHTML can't handle block children of inline elements just yet.
This commit is contained in:
parent
c51366b22c
commit
b0d2117bfd
1 changed files with 3 additions and 5 deletions
|
@ -27,12 +27,10 @@ String MDCodeBlock::render_to_html() const
|
||||||
if (style.emph)
|
if (style.emph)
|
||||||
builder.append("<i>");
|
builder.append("<i>");
|
||||||
|
|
||||||
builder.append("<pre>");
|
|
||||||
|
|
||||||
if (style_language.is_null())
|
if (style_language.is_null())
|
||||||
builder.append("<code>");
|
builder.append("<code style=\"white-space: pre;\">");
|
||||||
else
|
else
|
||||||
builder.appendf("<code class=\"%s\">", style_language.characters());
|
builder.appendf("<code style=\"white-space: pre;\" class=\"%s\">", style_language.characters());
|
||||||
|
|
||||||
// TODO: This should also be done in other places.
|
// TODO: This should also be done in other places.
|
||||||
for (int i = 0; i < m_code.length(); i++)
|
for (int i = 0; i < m_code.length(); i++)
|
||||||
|
@ -45,7 +43,7 @@ String MDCodeBlock::render_to_html() const
|
||||||
else
|
else
|
||||||
builder.append(m_code[i]);
|
builder.append(m_code[i]);
|
||||||
|
|
||||||
builder.append("</code></pre>");
|
builder.append("</code>");
|
||||||
|
|
||||||
if (style.emph)
|
if (style.emph)
|
||||||
builder.append("</i>");
|
builder.append("</i>");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue