Fix admonitions invoked with #+begin_

This commit is contained in:
Yaman Qalieh 2022-08-29 14:25:50 -04:00 committed by Fabrice Niessen
parent d7ecf839ad
commit d8cf56bb1f
2 changed files with 6 additions and 8 deletions

View File

@ -20,10 +20,9 @@ $( document ).ready(function() {
$(function() {
function replace_admonition (tag, readable) {
$(`.${tag}:not(#table-of-contents *)`)
.parent().parent().replaceWith(function() {
return `<p id='${this.id}' class='admonition-title ${tag}'>${readable}</p>`
});
$(`span.${tag}:not(#table-of-contents *)`) .parent().parent()
.replaceWith(`<p id='${this.id}' class='admonition-title ${tag}'>${readable}</p>`);
$(`div.${tag}`).before(`<p class='admonition-title ${tag}'>${readable}</p>`)
}
replace_admonition('note', 'Note');
replace_admonition('seealso', 'See also');

View File

@ -1491,10 +1491,9 @@ $( document ).ready(function() {
$(function() {
function replace_admonition (tag, readable) {
$(`.${tag}:not(#table-of-contents *)`)
.parent().parent().replaceWith(function() {
return `<p id='${this.id}' class='admonition-title ${tag}'>${readable}</p>`
});
$(`span.${tag}:not(#table-of-contents *)`) .parent().parent()
.replaceWith(`<p id='${this.id}' class='admonition-title ${tag}'>${readable}</p>`);
$(`div.${tag}`).before(`<p class='admonition-title ${tag}'>${readable}</p>`)
}
replace_admonition('note', 'Note');
replace_admonition('seealso', 'See also');