mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +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
Notes:
sideshowbarker
2024-07-18 12:33:06 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/a8946eb8885 Pull-request: https://github.com/SerenityOS/serenity/pull/7943 Issue: https://github.com/SerenityOS/serenity/issues/7131 Reviewed-by: https://github.com/linusg
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…
Reference in a new issue