aboutsummaryrefslogtreecommitdiffstats
path: root/markdown.py
diff options
context:
space:
mode:
authorArtem Yunusov <nedrlab@gmail.com>2008-07-03 21:53:03 +0500
committerArtem Yunusov <nedrlab@gmail.com>2008-07-03 21:53:03 +0500
commit33d3f28f8a01cbd0ec13bb55ec8ce3755deaa29a (patch)
treee98f22cd51cc770dc8541a2238bc703d5688d7fd /markdown.py
parentce843d036d0061d470dec006bb6e0300b0b3020f (diff)
downloadmarkdown-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.py6
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)