mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:38:10 +00:00
LibMarkdown: Use JS::MarkupGenerator for "js" code blocks :^)
This commit is contained in:
parent
10c19d5207
commit
0aeef47abd
2 changed files with 6 additions and 2 deletions
|
@ -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>");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue