diff options
author | Artem Yunusov <nedrlab@gmail.com> | 2008-07-03 21:53:03 +0500 |
---|---|---|
committer | Artem Yunusov <nedrlab@gmail.com> | 2008-07-03 21:53:03 +0500 |
commit | 33d3f28f8a01cbd0ec13bb55ec8ce3755deaa29a (patch) | |
tree | e98f22cd51cc770dc8541a2238bc703d5688d7fd /markdown.py | |
parent | ce843d036d0061d470dec006bb6e0300b0b3020f (diff) | |
download | markdown-33d3f28f8a01cbd0ec13bb55ec8ce3755deaa29a.tar.gz markdown-33d3f28f8a01cbd0ec13bb55ec8ce3755deaa29a.tar.bz2 markdown-33d3f28f8a01cbd0ec13bb55ec8ce3755deaa29a.zip |
Code blocks escaping bug fixed. Some test suite modifications.
Diffstat (limited to 'markdown.py')
-rw-r--r-- | markdown.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/markdown.py b/markdown.py index 56b4285..7a1e9d2 100644 --- a/markdown.py +++ b/markdown.py @@ -1315,7 +1315,7 @@ class InlineStash: def _genPlaceholder(self, type): """ Generates placeholder """ id = "%04d" % len(self._nodes) - hash = "%s%s:%s%s" % (self.prefix, type[0:3], id, + hash = "%s%s:%s%s" % (self.prefix, type, id, self.suffix) return hash, id @@ -1910,7 +1910,6 @@ class Markdown: result = [] prefix = self.inlineStash.prefix strartIndex = 0 - while data: index = data.find(prefix, strartIndex) @@ -1938,6 +1937,7 @@ class Markdown: child.value) pos = node.childNodes.index(child) node.removeChild(child) + childResult.reverse() for newChild in childResult: node.insertChild(pos, newChild) @@ -1986,7 +1986,7 @@ class Markdown: if not node: return data, False - if isinstance(node, Element): + if isinstance(node, Element) and not node.nodeName in ["code", "pre"]: for child in node.childNodes: if isinstance(child, TextNode): child.value = self._handleInline(child.value, patternIndex) |