Closed AlexisTM closed 9 years ago
No ideas. I think this problem is not directly related to this package http://stackoverflow.com/questions/1889076/is-it-recommended-to-use-the-base-html-tag.
Anyway renderer look is customizeable https://github.com/markdown-it/markdown-it-footnote/blob/master/index.js#L46-L51. You can hack it as you wish if you find solution.
Thanks! The solution was to customize the functions! (Posted in cas someone wonder)
var md = window.markdownit()
.use(window.markdownitFootnote);
md.renderer.rules.footnote_ref = function (tokens, idx) {
var n = Number(tokens[idx].meta.id + 1).toString();
var id = 'fnref' + n;
var uri = window.location.pathname;
if (tokens[idx].meta.subId > 0) {
id += ':' + tokens[idx].meta.subId;
}
return '<sup class="footnote-ref"><a href="' + uri + '#fn' + n + '" id="' + id + '">[' + n + ']</a></sup>';
};
md.renderer.rules.footnote_anchor = function(tokens, idx) {
var n = Number(tokens[idx].meta.id + 1).toString();
var id = 'fnref' + n;
var uri = window.location.pathname;
if (tokens[idx].meta.subId > 0) {
id += ':' + tokens[idx].meta.subId;
}
return ' <a href="' + uri + '#' + id + '" class="footnote-backref">\u21a9</a>'; /* ↩ */
};
Dear,
I am creating an HTML5 application with angular. To work I need to add the base URL in the html header.
Then when I click en the footnote, it do not redirect to the correct url.
Instead of
I wonder if you have any clues to make the plugin compatible or to fix the legacy HTML # .
Thanks !