summaryrefslogtreecommitdiff
path: root/markdown/inlinepatterns.py
diff options
context:
space:
mode:
authorWaylan Limberg <waylan.limberg@icloud.com>2015-03-29 23:00:30 -0400
committerWaylan Limberg <waylan.limberg@icloud.com>2015-04-22 19:53:48 -0400
commit0005d7a1c03faa89ccd8a4293741843afcdbbd9b (patch)
tree6b395ace96749320feb42747e57778e475c5ade8 /markdown/inlinepatterns.py
parentce5435a1e8d2186a1f4f61f7c35472e4b5d2db93 (diff)
downloadpython-markdown-0005d7a1c03faa89ccd8a4293741843afcdbbd9b.tar.gz
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.
Diffstat (limited to 'markdown/inlinepatterns.py')
-rw-r--r--markdown/inlinepatterns.py22
1 files changed, 1 insertions, 21 deletions
diff --git a/markdown/inlinepatterns.py b/markdown/inlinepatterns.py
index 4659e32..e920322 100644
--- a/markdown/inlinepatterns.py
+++ b/markdown/inlinepatterns.py
@@ -164,16 +164,6 @@ def dequote(string):
return string
-ATTR_RE = re.compile("\{@([^\}]*)=([^\}]*)}") # {@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 ATTR_RE.sub(attributeCallback, text)
-
-
"""
The pattern classes
-----------------------------------------------------------------------------
@@ -366,13 +356,7 @@ class ImagePattern(LinkPattern):
el.set('src', "")
if len(src_parts) > 1:
el.set('title', dequote(self.unescape(" ".join(src_parts[1:]))))
-
- if self.md.enable_attributes:
- truealt = handleAttributes(m.group(2), el)
- else:
- truealt = m.group(2)
-
- el.set('alt', self.unescape(truealt))
+ el.set('alt', self.unescape(m.group(2)))
return el
@@ -418,10 +402,6 @@ class ImageReferencePattern(ReferencePattern):
el.set("src", href)
if title:
el.set("title", title)
-
- if self.md.enable_attributes:
- text = handleAttributes(text, el)
-
el.set("alt", self.unescape(text))
return el