We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mistune 2.x here.
I'm trying to add the character • (bullet, unicode u2022) as a list item marker :
mistune.BlockParser.LIST_START = re.compile('( {0,3})([\\*\\+\\u2022\\-]|\\d{1,9}[.)])(?:[ \\t]*|[ \\t][^\\n]+)\\n+')
This ends with an infinite loop in the methode _create_list_item_pattern, since it doesn't match any of the default markdown markers :
_create_list_item_pattern
# mistune/block_parser.py:320 if marker == '*': prefix = prefix + r'\*' elif marker == '+': prefix = prefix + r'\+' else: prefix = prefix + r'-'
I finally made it work with the following else case :
else
# mistune/block_parser.py:320 if marker == '*': prefix = prefix + r'\*' elif marker == '+': prefix = prefix + r'\+' else: prefix = prefix + rf'{marker}'
Is there any risk to use a variable into the generated regex ? Is there any chance this change to be included in Mistune 2.x ?
The text was updated successfully, but these errors were encountered:
Actually this if else is not required:
prefix + re.escape(marker)
is enough
Sorry, something went wrong.
Fix list parser for customized list grammar.
71c9774
ref: #331
v2.0.5 is released.
No branches or pull requests
Mistune 2.x here.
I'm trying to add the character • (bullet, unicode u2022) as a list item marker :
This ends with an infinite loop in the methode
_create_list_item_pattern
, since it doesn't match any of the default markdown markers :I finally made it work with the following
else
case :Is there any risk to use a variable into the generated regex ? Is there any chance this change to be included in Mistune 2.x ?
The text was updated successfully, but these errors were encountered: