Skip to content

Commit

Permalink
feat: added docs footnotes support
Browse files Browse the repository at this point in the history
  • Loading branch information
zdm committed Oct 30, 2024
1 parent bc9e984 commit d99bb32
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions docs/assets/theme/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,13 @@ class Theme {
}

#linkifyFootnotes ( markdown ) {
console.log( "---", markdown, /\[\^([\w-]+)]:/.test( markdown ) );
if ( !markdown ) return markdown;

// [^1]:
markdown = markdown.replaceAll(

//
/\[\^([\w-]+)]:/g,
( match, id ) => `<strong class="footnote-reference" id="footnote-${ id }">[[${ id }]](#footnote-${ id })</strong>:leftwards_arrow_with_hook:`
( match, id ) => `<strong class="footnote-reference" id="footnote-${ id }">[[${ id }]](#footnote-${ id })</strong>:`
);

// [^1]
Expand Down

0 comments on commit d99bb32

Please sign in to comment.