Last active
February 25, 2023 16:51
-
-
Save dKvale/87e0bde5e6c0ed9e51480d7eb4c8ff86 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Pandoc 2.9 adds attributes on both header and div. We remove the former (to | |
// be compatible with the behavior of Pandoc < 2.8). | |
document.addEventListener('DOMContentLoaded', function(e) { | |
var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); | |
var i, h, a; | |
for (i = 0; i < hs.length; i++) { | |
h = hs[i]; | |
if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 | |
a = h.attributes; | |
while (a.length > 0) h.removeAttribute(a[0].name); | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment