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("", 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("");