LibMarkdown: Limit headings to 6 levels

This commit is contained in:
Peter Elliott 2022-04-24 22:56:00 -06:00 committed by Andreas Kling
parent c15c57a6af
commit 116e0dc4de
Notes: sideshowbarker 2024-07-17 11:32:03 +09:00

View File

@ -57,7 +57,7 @@ OwnPtr<Heading> Heading::parse(LineIterator& lines)
break; break;
} }
if (!level || level >= line.length() || line[level] != ' ') if (!level || level >= line.length() || line[level] != ' ' || level > 6)
return {}; return {};
StringView title_view = line.substring_view(level + 1, line.length() - level - 1); StringView title_view = line.substring_view(level + 1, line.length() - level - 1);