summaryrefslogtreecommitdiff
path: root/public/js/extra.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/js/extra.js')
-rw-r--r--public/js/extra.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/public/js/extra.js b/public/js/extra.js
index 91984c2c..d381576f 100644
--- a/public/js/extra.js
+++ b/public/js/extra.js
@@ -833,7 +833,11 @@ const linkifyAnchors = (level, containingElement) => {
if (header.getElementsByClassName('anchor').length === 0) {
if (typeof header.id === 'undefined' || header.id === '') {
// to escape characters not allow in css and humanize
- const id = slugifyWithUTF8(getHeaderContent(header))
+ let id = slugifyWithUTF8(getHeaderContent(header))
+ // to make compatible with GitHub, GitLab, Pandoc and many more
+ if (window.linkifyHeaderStyle !== 'keep-case') {
+ id = id.toLowerCase()
+ }
header.id = id
}
if (!(typeof header.id === 'undefined' || header.id === '')) {