mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
LibMarkdown: Use escape_html_entities() from AK/String
This commit is contained in:
parent
b7339745d0
commit
fc3d16d664
Notes:
sideshowbarker
2024-07-19 06:57:04 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/fc3d16d6646 Pull-request: https://github.com/SerenityOS/serenity/pull/2120
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());
|
||||
|
||||
// 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>");
|
||||
|
||||
|
|
Loading…
Reference in a new issue