@@ -860,7 +860,6 @@ const anchorForId = id => {
860
860
}
861
861
862
862
const createHeaderId = ( headerContent , headerIds = null ) => {
863
-
864
863
// to escape characters not allow in css and humanize
865
864
const slug = slugifyWithUTF8 ( headerContent )
866
865
let id
@@ -873,13 +872,13 @@ const createHeaderId = (headerContent, headerIds = null) => {
873
872
// see GitHub implementation reference:
874
873
// https://gist.github.com/asabaylus/3071099#gistcomment-1593627
875
874
// it works like 'lower-case', but ...
876
- const id_base = slug . toLowerCase ( )
877
- id = id_base
875
+ const idBase = slug . toLowerCase ( )
876
+ id = idBase
878
877
if ( headerIds !== null ) {
879
878
// ... making sure the id is unique
880
879
let i = 1
881
880
while ( headerIds . has ( id ) ) {
882
- id = id_base + '-' + i
881
+ id = idBase + '-' + i
883
882
i ++
884
883
}
885
884
headerIds . add ( id )
@@ -924,19 +923,17 @@ function getHeaderContent (header) {
924
923
}
925
924
926
925
function changeHeaderId ( $header , id , newId ) {
927
-
928
926
$header . attr ( 'id' , newId )
929
927
const $headerLink = $header . find ( `> a.anchor[href="#${ id } "]` )
930
928
$headerLink . attr ( 'href' , `#${ newId } ` )
931
929
$headerLink . attr ( 'title' , newId )
932
930
}
933
931
934
932
export function deduplicatedHeaderId ( view ) {
935
-
936
933
// headers contained in the last change
937
934
const headers = view . find ( ':header.raw' ) . removeClass ( 'raw' ) . toArray ( )
938
- if ( headers . length == 0 ) {
939
- return ;
935
+ if ( headers . length === 0 ) {
936
+ return
940
937
}
941
938
if ( window . linkifyHeaderStyle === 'gfm' ) {
942
939
// consistent with GitHub, GitLab, Pandoc & co.
0 commit comments