aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/document-to-html.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/document-to-html.js b/lib/document-to-html.js
index d7b6a86..faae02b 100644
--- a/lib/document-to-html.js
+++ b/lib/document-to-html.js
@@ -181,8 +181,13 @@ function DocumentConversion(options) {
});
},
"footnoteReference": function(element, html, messages, callback) {
+ var uid = footnoteUid(element.footnoteId);
+
html.open(htmlPaths.element("sup"));
- html.open(htmlPaths.element("a", {href: "#footnote-" + footnoteUid(element.footnoteId)}));
+ html.open(htmlPaths.element("a", {
+ href: "#footnote-" + uid,
+ id: "footnote-ref-" + uid
+ }));
footnoteIds.push(element.footnoteId);
html.text("[" + (footnoteNumber++) + "]");
html.close();
@@ -190,7 +195,9 @@ function DocumentConversion(options) {
callback();
},
"footnote": function(element, html, messages, callback) {
- html.open(htmlPaths.element("li", {id: "footnote-" + footnoteUid(element.id)}));
+ var uid = footnoteUid(element.id);
+
+ html.open(htmlPaths.element("li", {id: "footnote-" + uid}));
var footnoteHtml = new HtmlGenerator();
convertElements(element.body, footnoteHtml, messages, function(err) {
if (err) {
@@ -198,6 +205,10 @@ function DocumentConversion(options) {
} else {
footnoteHtml.closeAll();
html.append(footnoteHtml);
+ html.text(" ");
+ html.open(htmlPaths.element("a", {href: "#footnote-ref-" + uid}));
+ html.text("↑");
+ html.close();
html.close();
callback();
}