From 5c1f51316f17a85a5a27e987bbeafbe382ccb573 Mon Sep 17 00:00:00 2001 From: Alexey Pyltsyn Date: Thu, 11 Nov 2021 15:35:22 +0300 Subject: [PATCH] Add support for Unicode chars when detect headings IDs (#4086) --- beta/plugins/remark-header-custom-ids.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beta/plugins/remark-header-custom-ids.js b/beta/plugins/remark-header-custom-ids.js index 00d33aef..8965163a 100644 --- a/beta/plugins/remark-header-custom-ids.js +++ b/beta/plugins/remark-header-custom-ids.js @@ -32,7 +32,7 @@ module.exports = ({ visit(tree, 'heading', (node) => { // Support custom-id syntax. const rawHeader = toString(node); - const match = /^.+(\s*\{#([a-z0-9\-_]+?)\}\s*)$/.exec(rawHeader); + const match = /^.+(\s*\{#([\p{L}0-9\-_]+?)\}\s*)$/u.exec(rawHeader); const id = match ? match[2] : slugs.slug(rawHeader, maintainCase); if (match) { // Remove the custom ID part from the text node.