summaryrefslogtreecommitdiff
path: root/markdown/blockprocessors.py
diff options
context:
space:
mode:
authorWaylan Limberg <waylan.limberg@icloud.com>2022-01-10 13:47:41 -0500
committerWaylan Limberg <waylan.limberg@icloud.com>2022-01-10 13:57:57 -0500
commitaf38c42706f8dff93694d4a7572003dbd8b0ddc0 (patch)
treed2f879bce807e6be77967388c3543002d8b77181 /markdown/blockprocessors.py
parent1d41f13c774696d651921601c827ed500e2aa285 (diff)
downloadpython-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.py2
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):