@@ -25,7 +25,7 @@ export function initMarkupAnchors() {
25
25
const originalId = heading . id . replace ( / ^ u s e r - c o n t e n t - / , '' ) ;
26
26
const a = document . createElement ( 'a' ) ;
27
27
a . classList . add ( 'anchor' ) ;
28
- a . setAttribute ( 'href' , `#${ encodeURIComponent ( originalId ) } ` ) ;
28
+ a . setAttribute ( 'href' , `#${ decodeURIComponent ( originalId ) } ` ) ;
29
29
a . innerHTML = svg ( 'octicon-link' ) ;
30
30
a . addEventListener ( 'click' , ( e ) => {
31
31
scrollToAnchor ( e . currentTarget . getAttribute ( 'href' ) , false ) ;
@@ -38,8 +38,8 @@ export function initMarkupAnchors() {
38
38
const href = a . getAttribute ( 'href' ) ;
39
39
if ( ! href . startsWith ( '#user-content-' ) ) continue ;
40
40
const originalId = href . replace ( / ^ # u s e r - c o n t e n t - / , '' ) ;
41
- a . setAttribute ( 'href' , `#${ originalId } ` ) ;
42
- if ( a . closest ( '.markup' ) . querySelectorAll ( `a[name="${ originalId } "]` ) . length !== 1 ) {
41
+ a . setAttribute ( 'href' , `#${ decodeURIComponent ( originalId ) } ` ) ;
42
+ if ( a . closest ( '.markup' ) . querySelectorAll ( `a[name="${ decodeURIComponent ( originalId ) } "]` ) . length !== 1 ) {
43
43
a . addEventListener ( 'click' , ( e ) => {
44
44
scrollToAnchor ( e . currentTarget . getAttribute ( 'href' ) , false ) ;
45
45
} ) ;
0 commit comments