mirror of https://github.com/status-im/codimd.git
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:
parent
34c2bfcfc5
commit
905414d039
|
@ -867,7 +867,7 @@ const linkifyAnchors = (level, containingElement) => {
|
||||||
if (header.getElementsByClassName('anchor').length === 0) {
|
if (header.getElementsByClassName('anchor').length === 0) {
|
||||||
if (typeof header.id === 'undefined' || header.id === '') {
|
if (typeof header.id === 'undefined' || header.id === '') {
|
||||||
// to escape characters not allow in css and humanize
|
// 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
|
// to make compatible with GitHub, GitLab, Pandoc and many more
|
||||||
if (window.linkifyHeaderStyle !== 'keep-case') {
|
if (window.linkifyHeaderStyle !== 'keep-case') {
|
||||||
id = id.toLowerCase()
|
id = id.toLowerCase()
|
||||||
|
|
Loading…
Reference in New Issue