mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-05-17 11:22:28 +12:00
Fix crash when 7 pound signs are written alone on a line.
The code would look for trailing pound signs and would count all the way to the beginning and beyond, resulting in an out of bounds exception.
This commit is contained in:
parent
1ae0a77464
commit
caed3e9224
|
@ -279,7 +279,9 @@ class MarkdownTokenizer(HighlightTokenizer):
|
|||
|
||||
if level > 0 and level < len(text):
|
||||
# Count how many pound signs are at the end of the text.
|
||||
while escapedText[-trailingPoundCount -1] == "#":
|
||||
# Ignore starting pound signs when calculating trailing signs
|
||||
while level + trailingPoundCount < len(text) and \
|
||||
escapedText[-trailingPoundCount -1] == "#":
|
||||
trailingPoundCount += 1
|
||||
|
||||
token = Token()
|
||||
|
|
Loading…
Reference in a new issue