mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 01:08:11 +00:00
LibMarkdown: Use escape_html_entities() from AK/String
This commit is contained in:
parent
b7339745d0
commit
fc3d16d664
1 changed files with 1 additions and 9 deletions
|
@ -61,15 +61,7 @@ String CodeBlock::render_to_html() const
|
||||||
builder.appendf("<code style=\"white-space: pre;\" class=\"%s\">", style_language.characters());
|
builder.appendf("<code style=\"white-space: pre;\" class=\"%s\">", style_language.characters());
|
||||||
|
|
||||||
// TODO: This should also be done in other places.
|
// TODO: This should also be done in other places.
|
||||||
for (size_t i = 0; i < m_code.length(); i++)
|
builder.append(escape_html_entities(m_code));
|
||||||
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("</code>");
|
builder.append("</code>");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue