Alexey Pyltsyn
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
1 deletions
-
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.
|
|
|
|