aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2011-12-28 07:56:56 -0800
committerWaylan Limberg <waylan@gmail.com>2011-12-28 07:56:56 -0800
commiteb1c507ef4621c75d349457f38615c1374a274a8 (patch)
tree0a9c04474b02b779818e30d74f3c66b7023c7bab
parent2e3830b9bf3a0829db7a5d04f731b5019d28cc65 (diff)
parent1663d3fb0d6d7613efda49648ce86f8f72e52ff2 (diff)
downloadmarkdown-eb1c507ef4621c75d349457f38615c1374a274a8.tar.gz
markdown-eb1c507ef4621c75d349457f38615c1374a274a8.tar.bz2
markdown-eb1c507ef4621c75d349457f38615c1374a274a8.zip
Merge pull request #65 from startling/backlinks
New footnotes configuration option: BACKLINK_TEXT
-rw-r--r--markdown/extensions/footnotes.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/markdown/extensions/footnotes.py b/markdown/extensions/footnotes.py
index d05edda..2f3ceac 100644
--- a/markdown/extensions/footnotes.py
+++ b/markdown/extensions/footnotes.py
@@ -43,7 +43,11 @@ class FootnoteExtension(markdown.Extension):
'UNIQUE_IDS':
[False,
"Avoid name collisions across "
- "multiple calls to reset()."]}
+ "multiple calls to reset()."],
+ "BACKLINK_TEXT":
+ ["&#8617;",
+ "The text string that links from the footnote to the reader's place."]
+ }
for key, value in configs:
self.config[key][0] = value
@@ -282,9 +286,11 @@ class FootnoteTreeprocessor(markdown.treeprocessors.Treeprocessor):
class FootnotePostprocessor(markdown.postprocessors.Postprocessor):
""" Replace placeholders with html entities. """
+ def __init__(self, footnotes):
+ self.footnotes = footnotes
def run(self, text):
- text = text.replace(FN_BACKLINK_TEXT, "&#8617;")
+ text = text.replace(FN_BACKLINK_TEXT, self.footnotes.getConfig("BACKLINK_TEXT"))
return text.replace(NBSP_PLACEHOLDER, "&#160;")
def makeExtension(configs=[]):