diff options
author | Waylan Limberg <waylan.limberg@icloud.com> | 2015-03-29 23:00:30 -0400 |
---|---|---|
committer | Waylan Limberg <waylan.limberg@icloud.com> | 2018-07-24 11:40:13 -0400 |
commit | ee54678185234f01d3de6a6334f30c9bb3417783 (patch) | |
tree | d72e6bde812a59b6615b1b33ef878263ed6f5cc7 /markdown/inlinepatterns.py | |
parent | 727adc8a053402d3e9a38424ff67bde697674156 (diff) | |
download | markdown-ee54678185234f01d3de6a6334f30c9bb3417783.tar.gz markdown-ee54678185234f01d3de6a6334f30c9bb3417783.tar.bz2 markdown-ee54678185234f01d3de6a6334f30c9bb3417783.zip |
Moved enable_attributes keyword to extension: legacy_attrs.
If you have existing documents that use the legacy attributes format,
then you should enable the legacy_attrs extension for those documents.
Everyone is encouraged to use the attr_list extension going forward.
Closes #643. Work adapted from 0005d7a of the md3 branch.
Diffstat (limited to 'markdown/inlinepatterns.py')
-rw-r--r-- | markdown/inlinepatterns.py | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/markdown/inlinepatterns.py b/markdown/inlinepatterns.py index 18da73b..d67ef1f 100644 --- a/markdown/inlinepatterns.py +++ b/markdown/inlinepatterns.py @@ -154,17 +154,6 @@ def dequote(string): return string -ATTR_RE = re.compile(r"\{@([^\}]*)=([^\}]*)}") # {@id=123} - - -def handleAttributes(text, parent): - """Set values of an element based on attribute definitions ({@id=123}).""" - def attributeCallback(match): - parent.set(match.group(1), match.group(2).replace('\n', ' ')) - return '' - return ATTR_RE.sub(attributeCallback, text) - - """ The pattern classes ----------------------------------------------------------------------------- @@ -601,12 +590,7 @@ class ImageInlineProcessor(LinkInlineProcessor): if title is not None: el.set("title", title) - if self.markdown.enable_attributes: - truealt = handleAttributes(text, el) - else: - truealt = text - - el.set('alt', self.unescape(truealt)) + el.set('alt', self.unescape(text)) return el, m.start(0), index @@ -676,10 +660,6 @@ class ImageReferenceInlineProcessor(ReferenceInlineProcessor): el.set("src", href) if title: el.set("title", title) - - if self.markdown.enable_attributes: - text = handleAttributes(text, el) - el.set("alt", self.unescape(text)) return el |