diff options
author | Linus Groh <mail@linusgroh.de> | 2020-05-05 15:03:54 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-05-05 16:18:11 +0200 |
commit | fc3d16d6646f7977067eae3fb0feb103704506c7 (patch) | |
tree | 86a3a117f31d5486531a17e54f14905b3273a5aa /Libraries/LibMarkdown/CodeBlock.cpp | |
parent | b7339745d0fa557f4156c8239f28118b929772ab (diff) | |
download | serenity-fc3d16d6646f7977067eae3fb0feb103704506c7.zip |
LibMarkdown: Use escape_html_entities() from AK/String
Diffstat (limited to 'Libraries/LibMarkdown/CodeBlock.cpp')
-rw-r--r-- | Libraries/LibMarkdown/CodeBlock.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/Libraries/LibMarkdown/CodeBlock.cpp b/Libraries/LibMarkdown/CodeBlock.cpp index c940cd5322..ca27dad1bf 100644 --- a/Libraries/LibMarkdown/CodeBlock.cpp +++ b/Libraries/LibMarkdown/CodeBlock.cpp @@ -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>"); |