Make `id` block-scoped (thanks @Yukaii)

Co-Authored-By: Yukai Huang <yukaihuangtw@gmail.com>
Signed-off-by: hoijui <hoijui.quaero@gmail.com>
This commit is contained in:
hoijui 2019-10-22 08:40:02 +02:00
parent 34c2bfcfc5
commit 905414d039
1 changed files with 1 additions and 1 deletions

View File

@ -867,7 +867,7 @@ 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
var 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()