mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-27 11:48:59 +00:00
LibMarkdown: Don't parse lines starting with a space as heading
This fixes a bug where lines starting with a space would get parsed as "level 0" headings - it would not find a "#" and therefore never increase the level counter (starting at zero), which then would cause the check for "space after #" pass (again, there is no "#"). Eventually we would get funny results like this: <h0>[n-1 spaces]oops!</h0> Also ASSERT(level > 0) in the Heading constructor.
This commit is contained in:
parent
63dcd59fa5
commit
9735879318
Notes:
sideshowbarker
2024-07-19 01:42:10 +09:00
Author: https://github.com/linusg
Commit: 9735879318
Pull-request: https://github.com/SerenityOS/serenity/pull/3859
2 changed files with 4 additions and 2 deletions
|
@ -40,6 +40,7 @@ public:
|
|||
: m_text(move(text))
|
||||
, m_level(level)
|
||||
{
|
||||
ASSERT(m_level > 0);
|
||||
}
|
||||
virtual ~Heading() override { }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue