prevent very large headline prefixes
for example: `<h9999999>` could crash the conversion. fixes #143
This commit is contained in:
@@ -315,6 +315,9 @@ class MarkdownConverter(object):
|
||||
if convert_as_inline:
|
||||
return text
|
||||
|
||||
# prevent MemoryErrors in case of very large n
|
||||
n = max(1, min(6, n))
|
||||
|
||||
style = self.options['heading_style'].lower()
|
||||
text = text.strip()
|
||||
if style == UNDERLINED and n <= 2:
|
||||
|
||||
Reference in New Issue
Block a user