1
0

Restrict attribute names

This commit is contained in:
Zef Hemel 2023-07-25 10:52:14 +02:00
parent 95df296197
commit 41fb82b9d2

View File

@ -142,7 +142,7 @@ export const Highlight: MarkdownConfig = {
], ],
}; };
export const attributeRegex = /^\[([^:]+)(::\s*)([^\]]+)\]/; export const attributeRegex = /^\[(\w+)(::\s*)([^\]]+)\]/;
export const Attribute: MarkdownConfig = { export const Attribute: MarkdownConfig = {
defineNodes: [ defineNodes: [
@ -164,7 +164,7 @@ export const Attribute: MarkdownConfig = {
) { ) {
return -1; return -1;
} }
const [fullMatch, attributeName, attributeColon, attributeValue] = const [fullMatch, attributeName, attributeColon, _attributeValue] =
match; match;
const endPos = pos + fullMatch.length; const endPos = pos + fullMatch.length;