Skip to content

Commit 5c1f513

Browse files
authored
Add support for Unicode chars when detect headings IDs (#4086)
1 parent f31c9fd commit 5c1f513

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

beta/plugins/remark-header-custom-ids.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module.exports = ({
3232
visit(tree, 'heading', (node) => {
3333
// Support custom-id syntax.
3434
const rawHeader = toString(node);
35-
const match = /^.+(\s*\{#([a-z0-9\-_]+?)\}\s*)$/.exec(rawHeader);
35+
const match = /^.+(\s*\{#([\p{L}0-9\-_]+?)\}\s*)$/u.exec(rawHeader);
3636
const id = match ? match[2] : slugs.slug(rawHeader, maintainCase);
3737
if (match) {
3838
// Remove the custom ID part from the text node.

0 commit comments

Comments
 (0)