mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 03:37:53 +00:00
LibMarkdown: Use escape_html_entities() from AK/String
This commit is contained in:
committed by
Andreas Kling
parent
b7339745d0
commit
fc3d16d664
@@ -61,15 +61,7 @@ String CodeBlock::render_to_html() const
|
||||
builder.appendf("<code style=\"white-space: pre;\" class=\"%s\">", style_language.characters());
|
||||
|
||||
// TODO: This should also be done in other places.
|
||||
for (size_t i = 0; i < m_code.length(); i++)
|
||||
if (m_code[i] == '<')
|
||||
builder.append("<");
|
||||
else if (m_code[i] == '>')
|
||||
builder.append(">");
|
||||
else if (m_code[i] == '&')
|
||||
builder.append("&");
|
||||
else
|
||||
builder.append(m_code[i]);
|
||||
builder.append(escape_html_entities(m_code));
|
||||
|
||||
builder.append("</code>");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user