diff --git a/Tests/LibWeb/Text/expected/HTML/document-write-flush-character-insertions.txt b/Tests/LibWeb/Text/expected/HTML/document-write-flush-character-insertions.txt
new file mode 100644
index 00000000000..465701e3460
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/HTML/document-write-flush-character-insertions.txt
@@ -0,0 +1 @@
+PASS
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/input/HTML/document-write-flush-character-insertions.html b/Tests/LibWeb/Text/input/HTML/document-write-flush-character-insertions.html
new file mode 100644
index 00000000000..2098b00c670
--- /dev/null
+++ b/Tests/LibWeb/Text/input/HTML/document-write-flush-character-insertions.html
@@ -0,0 +1,6 @@
+
+
diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp
index 2df5288cea7..f6b689237fa 100644
--- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp
+++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp
@@ -177,7 +177,7 @@ void HTMLParser::run(HTMLTokenizer::StopAtInsertionPoint stop_at_insertion_point
for (;;) {
// FIXME: Find a better way to say that we come from Document::close() and want to process EOF.
if (!m_tokenizer.is_eof_inserted() && m_tokenizer.is_insertion_point_reached())
- return;
+ break;
auto optional_token = m_tokenizer.next_token(stop_at_insertion_point);
if (!optional_token.has_value())