@@ -25,7 +25,7 @@ export function initMarkupAnchors() {
2525 const originalId = heading . id . replace ( / ^ u s e r - c o n t e n t - / , '' ) ;
2626 const a = document . createElement ( 'a' ) ;
2727 a . classList . add ( 'anchor' ) ;
28- a . setAttribute ( 'href' , `#${ encodeURIComponent ( originalId ) } ` ) ;
28+ a . setAttribute ( 'href' , `#${ decodeURIComponent ( originalId ) } ` ) ;
2929 a . innerHTML = svg ( 'octicon-link' ) ;
3030 a . addEventListener ( 'click' , ( e ) => {
3131 scrollToAnchor ( e . currentTarget . getAttribute ( 'href' ) , false ) ;
@@ -38,8 +38,8 @@ export function initMarkupAnchors() {
3838 const href = a . getAttribute ( 'href' ) ;
3939 if ( ! href . startsWith ( '#user-content-' ) ) continue ;
4040 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 ) {
4343 a . addEventListener ( 'click' , ( e ) => {
4444 scrollToAnchor ( e . currentTarget . getAttribute ( 'href' ) , false ) ;
4545 } ) ;
0 commit comments