aboutsummaryrefslogtreecommitdiffstats
path: root/markdown
diff options
context:
space:
mode:
authorJorge Maldonado Ventura <jorgesumle@freakspot.net>2017-12-23 00:00:07 +0100
committerWaylan Limberg <waylan.limberg@icloud.com>2017-12-22 18:00:07 -0500
commitbc5a9bb02ae5d171d42978078344050034edc106 (patch)
tree6423e07613b253f126fc4acfdfd6d197d24eb862 /markdown
parent1edbb9dcb998966e43e02f5e345fe3d08c0307dc (diff)
downloadmarkdown-bc5a9bb02ae5d171d42978078344050034edc106.tar.gz
markdown-bc5a9bb02ae5d171d42978078344050034edc106.tar.bz2
markdown-bc5a9bb02ae5d171d42978078344050034edc106.zip
[Footnote extension] Add a way to customize the backlink title (#616)
Fixes #610.
Diffstat (limited to 'markdown')
-rw-r--r--markdown/extensions/footnotes.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/markdown/extensions/footnotes.py b/markdown/extensions/footnotes.py
index 7edf813..620cf0b 100644
--- a/markdown/extensions/footnotes.py
+++ b/markdown/extensions/footnotes.py
@@ -49,7 +49,12 @@ class FootnoteExtension(Extension):
"BACKLINK_TEXT":
["&#8617;",
"The text string that links from the footnote "
- "to the reader's place."]
+ "to the reader's place."],
+ "BACKLINK_TITLE":
+ ["Jump back to footnote %d in the text",
+ "The text string used for the title HTML attribute "
+ "of the backlink. %d will be replaced by the "
+ "footnote number."]
}
super(FootnoteExtension, self).__init__(*args, **kwargs)
@@ -192,7 +197,7 @@ class FootnoteExtension(Extension):
backlink.set("class", "footnote-backref")
backlink.set(
"title",
- "Jump back to footnote %d in the text" %
+ self.getConfig("BACKLINK_TITLE") %
(self.footnotes.index(id)+1)
)
backlink.text = FN_BACKLINK_TEXT