summaryrefslogtreecommitdiff
path: root/markdown/treeprocessors.py
diff options
context:
space:
mode:
authorWaylan Limberg <waylan.limberg@icloud.com>2015-06-21 21:21:49 -0400
committerWaylan Limberg <waylan.limberg@icloud.com>2015-06-21 21:21:49 -0400
commit3c69b0fb1d86f68a337bf3bd9b4a86b30a5fe6bf (patch)
tree6972f33b04d940e77486818e6676755550817107 /markdown/treeprocessors.py
parentde76d24283aa62a81e2c4529c4d90fb388ddd26d (diff)
downloadpython-markdown-inline.tar.gz
Fixed many failing tests in inline refactor. Still a ways to go.inline
Diffstat (limited to 'markdown/treeprocessors.py')
-rw-r--r--markdown/treeprocessors.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/markdown/treeprocessors.py b/markdown/treeprocessors.py
index d2036f6..c07acdc 100644
--- a/markdown/treeprocessors.py
+++ b/markdown/treeprocessors.py
@@ -48,7 +48,7 @@ class InlineProcessor(Treeprocessor):
def __init__(self, md):
super(InlineProcessor, self).__init__(md)
- self.TOKEN_RE = re.compile(r'|'.join('\\{0}'.format(x) for x in md.ESCAPED_CHARS))
+ self.TOKEN_RE = re.compile(r'|'.join('\\{0}'.format(x) for x in md.ESCAPED_CHARS + [' \n']))
def apply_patterns(self, text):
"""
@@ -61,10 +61,11 @@ class InlineProcessor(Treeprocessor):
match = pattern.getCompiledRegExp().match(text)
if match:
node = pattern.handleMatch(match)
- text = text[match.end():]
+ if node is not None:
+ text = text[match.end():]
break
- if not match:
+ if not match or node is None:
# Step forward one character
return text[0], None, text[1:]