Bläddra i källkod

LibMarkdown: Escape HTML entities in text

Linus Groh 5 år sedan
förälder
incheckning
0a1ecbec48
2 ändrade filer med 1 tillägg och 2 borttagningar
  1. 0 1
      Libraries/LibMarkdown/CodeBlock.cpp
  2. 1 1
      Libraries/LibMarkdown/Text.cpp

+ 0 - 1
Libraries/LibMarkdown/CodeBlock.cpp

@@ -60,7 +60,6 @@ String CodeBlock::render_to_html() const
     else
         builder.appendf("<code style=\"white-space: pre;\" class=\"%s\">", style_language.characters());
 
-    // TODO: This should also be done in other places.
     builder.append(escape_html_entities(m_code));
 
     builder.append("</code>");

+ 1 - 1
Libraries/LibMarkdown/Text.cpp

@@ -113,7 +113,7 @@ String Text::render_to_html() const
         }
 
         current_style = span.style;
-        builder.append(span.text);
+        builder.append(escape_html_entities(span.text));
     }
 
     for (ssize_t i = open_tags.size() - 1; i >= 0; --i) {