mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:48:14 +00:00
LibMarkdown: Wrap non-inline code blocks in <pre>
This fixes #7131 The parser already distinguishes between inline code (handled in Text.cpp) and triple-tick code blocks, so only CodeBlock::render_to_html() needed to change. Blank lines within a code block still cause issues, but that's an HTML issue. (#7121)
This commit is contained in:
parent
f437793788
commit
a8946eb888
1 changed files with 3 additions and 1 deletions
|
@ -31,6 +31,8 @@ String CodeBlock::render_to_html() const
|
|||
String style_language = this->style_language();
|
||||
Text::Style style = this->style();
|
||||
|
||||
builder.append("<pre>");
|
||||
|
||||
if (style.strong)
|
||||
builder.append("<b>");
|
||||
if (style.emph)
|
||||
|
@ -53,7 +55,7 @@ String CodeBlock::render_to_html() const
|
|||
if (style.strong)
|
||||
builder.append("</b>");
|
||||
|
||||
builder.append('\n');
|
||||
builder.append("</pre>\n");
|
||||
|
||||
return builder.build();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue