diff options
author | Waylan Limberg <waylan@gmail.com> | 2012-04-17 06:36:33 -0700 |
---|---|---|
committer | Waylan Limberg <waylan@gmail.com> | 2012-04-17 06:36:33 -0700 |
commit | 4d2b83bfa01f218ae10cc20044c9636110a9baf2 (patch) | |
tree | b2eaf1d92fbe29d5c4414eac79744ee38af59a58 | |
parent | 81a25ffbe1f11377ccb76e3085059805972ab8a5 (diff) | |
parent | 30b7ad6c10b1512eb2622baef3ff48ef82220081 (diff) | |
download | markdown-4d2b83bfa01f218ae10cc20044c9636110a9baf2.tar.gz markdown-4d2b83bfa01f218ae10cc20044c9636110a9baf2.tar.bz2 markdown-4d2b83bfa01f218ae10cc20044c9636110a9baf2.zip |
Merge pull request #95 from cataliniacob/master
Attempted fix for issue 87
-rw-r--r-- | markdown/treeprocessors.py | 13 | ||||
-rw-r--r-- | tests/misc/no-attributes.html | 2 | ||||
-rw-r--r-- | tests/misc/no-attributes.txt | 3 | ||||
-rw-r--r-- | tests/misc/test.cfg | 2 |
4 files changed, 14 insertions, 6 deletions
diff --git a/markdown/treeprocessors.py b/markdown/treeprocessors.py index 3340554..841fe0a 100644 --- a/markdown/treeprocessors.py +++ b/markdown/treeprocessors.py @@ -304,14 +304,15 @@ class InlineProcessor(Treeprocessor): if child.getchildren(): stack.append(child) - if self.markdown.enable_attributes: - for element, lst in insertQueue: + for element, lst in insertQueue: + if self.markdown.enable_attributes: if element.text: element.text = \ inlinepatterns.handleAttributes(element.text, element) - i = 0 - for newChild in lst: + i = 0 + for newChild in lst: + if self.markdown.enable_attributes: # Processing attributes if newChild.tail: newChild.tail = \ @@ -321,8 +322,8 @@ class InlineProcessor(Treeprocessor): newChild.text = \ inlinepatterns.handleAttributes(newChild.text, newChild) - element.insert(i, newChild) - i += 1 + element.insert(i, newChild) + i += 1 return tree diff --git a/tests/misc/no-attributes.html b/tests/misc/no-attributes.html new file mode 100644 index 0000000..a72e888 --- /dev/null +++ b/tests/misc/no-attributes.html @@ -0,0 +1,2 @@ +<p>Regression <em>test</em> for issue 87</p> +<p>It's run with enable_attributes=False so this {@id=explanation} should not become an attribute</p>
\ No newline at end of file diff --git a/tests/misc/no-attributes.txt b/tests/misc/no-attributes.txt new file mode 100644 index 0000000..b2cb653 --- /dev/null +++ b/tests/misc/no-attributes.txt @@ -0,0 +1,3 @@ +Regression *test* for issue 87 + +It's run with enable_attributes=False so this {@id=explanation} should not become an attribute diff --git a/tests/misc/test.cfg b/tests/misc/test.cfg new file mode 100644 index 0000000..21e0061 --- /dev/null +++ b/tests/misc/test.cfg @@ -0,0 +1,2 @@ +[no-attributes] +enable_attributes=False
\ No newline at end of file |