mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-16 05:49:43 +02:00
chore: allow comments to adjust keywords
This commit is contained in:
@@ -20,7 +20,7 @@ export abstract class MermaidTokenBuilder extends DefaultTokenBuilder {
|
|||||||
// to restrict users, they mustn't have any non-whitespace characters after the keyword.
|
// to restrict users, they mustn't have any non-whitespace characters after the keyword.
|
||||||
tokenTypes.forEach((tokenType: TokenType): void => {
|
tokenTypes.forEach((tokenType: TokenType): void => {
|
||||||
if (this.keywords.has(tokenType.name) && tokenType.PATTERN !== undefined) {
|
if (this.keywords.has(tokenType.name) && tokenType.PATTERN !== undefined) {
|
||||||
tokenType.PATTERN = new RegExp(tokenType.PATTERN.toString() + '(?!\\S)');
|
tokenType.PATTERN = new RegExp(tokenType.PATTERN.toString() + '(?:(?=%%)|(?!\\S))');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return tokenTypes;
|
return tokenTypes;
|
||||||
|
Reference in New Issue
Block a user