diff --git a/Userland/Libraries/LibMarkdown/Heading.cpp b/Userland/Libraries/LibMarkdown/Heading.cpp index c4b54aef917..2eb24c04479 100644 --- a/Userland/Libraries/LibMarkdown/Heading.cpp +++ b/Userland/Libraries/LibMarkdown/Heading.cpp @@ -57,7 +57,7 @@ OwnPtr Heading::parse(LineIterator& lines) break; } - if (!level || level >= line.length() || line[level] != ' ') + if (!level || level >= line.length() || line[level] != ' ' || level > 6) return {}; StringView title_view = line.substring_view(level + 1, line.length() - level - 1);