mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-14 04:49:44 +02:00
Merge remote-tracking branch 'origin/develop' into feature/frontmatterConfig
* origin/develop: chore: Remove duplicate CI action chore: Add circular dependency check in CI refactor: Remove circular dependencies
This commit is contained in:
@@ -32,6 +32,7 @@ import assignWithDepth from './assignWithDepth.js';
|
||||
import { MermaidConfig } from './config.type.js';
|
||||
import memoize from 'lodash-es/memoize.js';
|
||||
import merge from 'lodash-es/merge.js';
|
||||
import { directiveRegex } from './diagram-api/regexes.js';
|
||||
|
||||
export const ZERO_WIDTH_SPACE = '\u200b';
|
||||
|
||||
@@ -58,7 +59,7 @@ const d3CurveTypes = {
|
||||
curveStepAfter: curveStepAfter,
|
||||
curveStepBefore: curveStepBefore,
|
||||
};
|
||||
const directive = /%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi;
|
||||
|
||||
const directiveWithoutOpen =
|
||||
/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi;
|
||||
|
||||
@@ -167,10 +168,10 @@ export const detectDirective = function (
|
||||
);
|
||||
let match;
|
||||
const result = [];
|
||||
while ((match = directive.exec(text)) !== null) {
|
||||
while ((match = directiveRegex.exec(text)) !== null) {
|
||||
// This is necessary to avoid infinite loops with zero-width matches
|
||||
if (match.index === directive.lastIndex) {
|
||||
directive.lastIndex++;
|
||||
if (match.index === directiveRegex.lastIndex) {
|
||||
directiveRegex.lastIndex++;
|
||||
}
|
||||
if (
|
||||
(match && !type) ||
|
||||
|
Reference in New Issue
Block a user