Skip to content

Commit f44f61c

Browse files
committed
Support hyphens
1 parent 1964eda commit f44f61c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sy-records/docsify-footnotes",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "A plugin that supports the use of footnotes in docsify.",
55
"main": "src/index.js",
66
"repository": {

src/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
const footnotes = function(hook) {
22
hook.beforeEach(function (html) {
3-
if (/\[\^([A-Za-z0-9]+)\][^:]/.test(html)) {
3+
if (/\[\^([A-Za-z0-9\-]+)\][^:]/.test(html)) {
44
html = html
5-
.replace(/\[\^([A-Za-z0-9]+)\][^:]/gm, '<sup class="footnote-symbol" id="fn-$1">[\[$1]\](#fnref-$1)</sup>')
6-
.replace(/\[\^([A-Za-z0-9]+)\]\: /gm, '<strong class="footnote-reference-symbol" id="fnref-$1">[\[$1\]](#fn-$1)</strong>:leftwards_arrow_with_hook: ');
5+
.replace(/\[\^([A-Za-z0-9\-]+)\][^:]/gm, '<sup class="footnote-symbol" id="fn-$1">[\[$1]\](#fnref-$1)</sup>')
6+
.replace(/\[\^([A-Za-z0-9\-]+)\]\: /gm, '<strong class="footnote-reference-symbol" id="fnref-$1">[\[$1\]](#fn-$1)</strong>:leftwards_arrow_with_hook: ');
77
}
88
return html;
99
});

0 commit comments

Comments
 (0)