diff --git a/Libraries/LibWeb/DOM/Element.cpp b/Libraries/LibWeb/DOM/Element.cpp index fa8ea02217..8c14451599 100644 --- a/Libraries/LibWeb/DOM/Element.cpp +++ b/Libraries/LibWeb/DOM/Element.cpp @@ -316,8 +316,10 @@ String Element::inner_html() const builder.append('>'); } if (child->is_text()) { - builder.append(downcast(*child).data()); + auto& text = downcast(*child); + builder.append(escape_string(text.data(), false)); } + // FIXME: Also handle Comment, ProcessingInstruction, DocumentType } }; recurse(*this);