aboutsummaryrefslogtreecommitdiffstats
path: root/markdown.py
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2007-10-30 01:59:40 +0000
committerWaylan Limberg <waylan@gmail.com>2007-10-30 01:59:40 +0000
commitb23d4874cb101f716f6285a3a683b8c90621ca78 (patch)
tree8b26ae233d2c47661a851a68a3401fb7c7aafe1f /markdown.py
parent262228bd6afdab5602e960be9b2cc772cd6aad19 (diff)
downloadmarkdown-b23d4874cb101f716f6285a3a683b8c90621ca78.tar.gz
markdown-b23d4874cb101f716f6285a3a683b8c90621ca78.tar.bz2
markdown-b23d4874cb101f716f6285a3a683b8c90621ca78.zip
Fixed infinite loop in bracket regex and added tests
Diffstat (limited to 'markdown.py')
-rw-r--r--markdown.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/markdown.py b/markdown.py
index e563866..181de1d 100644
--- a/markdown.py
+++ b/markdown.py
@@ -640,8 +640,8 @@ So, we apply the expressions in the following order:
NOBRACKET = r'[^\]\[]*'
BRK = ( r'\[('
- + (NOBRACKET + r'(\['+NOBRACKET)*6
- + (NOBRACKET+ r'\])*'+NOBRACKET)*6
+ + (NOBRACKET + r'(\[')*6
+ + (NOBRACKET+ r'\])*')*6
+ NOBRACKET + r')\]' )
BACKTICK_RE = r'\`([^\`]*)\`' # `e= m*c^2`