mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:47:35 +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
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