mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-29 12:49:08 +00:00
LibMarkdown: Use JS::MarkupGenerator for "js" code blocks :^)
This commit is contained in:
committed by
Andreas Kling
parent
10c19d5207
commit
0aeef47abd
@@ -25,6 +25,7 @@
|
||||
*/
|
||||
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <LibJS/MarkupGenerator.h>
|
||||
#include <LibMarkdown/CodeBlock.h>
|
||||
|
||||
namespace Markdown {
|
||||
@@ -60,7 +61,10 @@ String CodeBlock::render_to_html() const
|
||||
else
|
||||
builder.appendff("<code class=\"{}\">", style_language);
|
||||
|
||||
builder.append(escape_html_entities(m_code));
|
||||
if (style_language == "js")
|
||||
builder.append(JS::MarkupGenerator::html_from_source(m_code));
|
||||
else
|
||||
builder.append(escape_html_entities(m_code));
|
||||
|
||||
builder.append("</code>");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user