From 116e0dc4dec62c18e71a517b0564860e0945ad30 Mon Sep 17 00:00:00 2001 From: Peter Elliott Date: Sun, 24 Apr 2022 22:56:00 -0600 Subject: [PATCH] LibMarkdown: Limit headings to 6 levels --- Userland/Libraries/LibMarkdown/Heading.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);