Skip to content
Snippets Groups Projects
Commit fedeebd7 authored by Anika Henke's avatar Anika Henke
Browse files

rewrote js for footnotes to work in xhtml

parent 250ce76b
No related branches found
No related tags found
No related merge requests found
......@@ -147,7 +147,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}
// add footnote markup and close this footnote
$this->doc .= $footnote;
$this->doc .= '<span class="content">'.$footnote.'</span>';
$this->doc .= '</div>'.DOKU_LF;
}
}
......
......@@ -83,23 +83,26 @@ dw_page = {
*
* @author Andreas Gohr <andi@splitbrain.org>
* @author Chris Smith <chris@jalakai.co.uk>
* @author Anika Henke <anika@selfthinker.org>
*/
footnoteDisplay: function () {
var content = jQuery(jQuery(this).attr('href')) // Footnote text anchor
.closest('div.fn').html();
var $content = jQuery(jQuery(this).attr('href')) // Footnote text anchor
.parent().siblings('.content').clone();
if (content === null){
if (!$content) {
return;
}
// strip the leading content anchors and their comma separators
content = content.replace(/((^|\s*,\s*)<sup>.*?<\/sup>)+\s*/gi, '');
// prefix ids on any elements with "insitu__" to ensure they remain unique
content = content.replace(/\bid=(['"])([^"']+)\1/gi,'id="insitu__$2');
jQuery('[id]', $content).each(function(){
var id = jQuery(this).attr('id');
jQuery(this).attr('id', 'insitu__' + id);
});
var content = $content.html().trim();
// now put the content into the wrapper
dw_page.insituPopup(this, 'insitu__fn').html(content).show().attr('aria-hidden', 'false');
dw_page.insituPopup(this, 'insitu__fn').html(content)
.show().attr('aria-hidden', 'false');
},
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment