diff options
author | Waylan Limberg <waylan.limberg@icloud.com> | 2022-01-10 13:47:41 -0500 |
---|---|---|
committer | Waylan Limberg <waylan.limberg@icloud.com> | 2022-01-10 13:57:57 -0500 |
commit | af38c42706f8dff93694d4a7572003dbd8b0ddc0 (patch) | |
tree | d2f879bce807e6be77967388c3543002d8b77181 /markdown/blockprocessors.py | |
parent | 1d41f13c774696d651921601c827ed500e2aa285 (diff) | |
download | python-markdown-af38c42706f8dff93694d4a7572003dbd8b0ddc0.tar.gz |
Disallow square brackets in reference link ids.
We already disallow right square brackets. This also disallows left
square brackets, which ensures link references will be less likely
to collide with standard links in some weird edge cases. Fixes #1209.
Diffstat (limited to 'markdown/blockprocessors.py')
-rw-r--r-- | markdown/blockprocessors.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/markdown/blockprocessors.py b/markdown/blockprocessors.py index dac3f08..d901beb 100644 --- a/markdown/blockprocessors.py +++ b/markdown/blockprocessors.py @@ -559,7 +559,7 @@ class EmptyBlockProcessor(BlockProcessor): class ReferenceProcessor(BlockProcessor): """ Process link references. """ RE = re.compile( - r'^[ ]{0,3}\[([^\]]*)\]:[ ]*\n?[ ]*([^\s]+)[ ]*(?:\n[ ]*)?((["\'])(.*)\4[ ]*|\((.*)\)[ ]*)?$', re.MULTILINE + r'^[ ]{0,3}\[([^\[\]]*)\]:[ ]*\n?[ ]*([^\s]+)[ ]*(?:\n[ ]*)?((["\'])(.*)\4[ ]*|\((.*)\)[ ]*)?$', re.MULTILINE ) def test(self, parent, block): |