diff options
author | Waylan Limberg <waylan@gmail.com> | 2013-03-18 23:48:16 -0400 |
---|---|---|
committer | Waylan Limberg <waylan@gmail.com> | 2013-03-18 23:48:16 -0400 |
commit | 0f548dafad6a58bf6ef3b13dc9a058abf53a8a21 (patch) | |
tree | 6c91f1094bb72976349b22f699d1a7c49fd8bdb3 | |
parent | dea54777a244c6593314dcd7b365eb7addbc8c99 (diff) | |
download | markdown-0f548dafad6a58bf6ef3b13dc9a058abf53a8a21.tar.gz markdown-0f548dafad6a58bf6ef3b13dc9a058abf53a8a21.tar.bz2 markdown-0f548dafad6a58bf6ef3b13dc9a058abf53a8a21.zip |
Ensure handleAttributes doesn't lose AtomicStrings.
Fixes #204. This was a real pain to debug. But I think the problem stemmed
from the fact that the footnote extension inserted a etree link into the
footnotes last p element. Then when inline patterns are run, the inline code
in that p element is processed. Normally, code would be the first child found,
but with the pre-existing link, that wasn't the case and the parser took a
slightly differant path which would never be encountered in any other
situation. It was this slightly differant path that made the lose of the
AtomicString status of the inline code matter.
Since any AtomicString (including inline code) doesn't need to be run though
hanldeAttributes anyway, we can just skip over it and preserve the
AtomicString. Whew!
-rw-r--r-- | markdown/treeprocessors.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/markdown/treeprocessors.py b/markdown/treeprocessors.py index 2df80f8..e6d3dc9 100644 --- a/markdown/treeprocessors.py +++ b/markdown/treeprocessors.py @@ -301,7 +301,7 @@ class InlineProcessor(Treeprocessor): for element, lst in insertQueue: if self.markdown.enable_attributes: - if element.text: + if element.text and isString(element.text): element.text = \ inlinepatterns.handleAttributes(element.text, element) @@ -309,11 +309,11 @@ class InlineProcessor(Treeprocessor): for newChild in lst: if self.markdown.enable_attributes: # Processing attributes - if newChild.tail: + if newChild.tail and isString(newChild.tail): newChild.tail = \ inlinepatterns.handleAttributes(newChild.tail, element) - if newChild.text: + if newChild.text and isString(newChild.text): newChild.text = \ inlinepatterns.handleAttributes(newChild.text, newChild) |