mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
Fixed regex bug
This commit is contained in:
parent
0475591fb6
commit
e3760d1709
@ -95,7 +95,7 @@ mermaid.initialize(config);
|
||||
|
||||
#### Defined in
|
||||
|
||||
[mermaidAPI.ts:661](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L661)
|
||||
[mermaidAPI.ts:662](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaidAPI.ts#L662)
|
||||
|
||||
## Functions
|
||||
|
||||
|
@ -399,7 +399,8 @@ const render = async function (
|
||||
// clean up text CRLFs
|
||||
text = text.replace(/\r\n?/g, '\n'); // parser problems on CRLF ignore all CR and leave LF;;
|
||||
|
||||
text = text.replace(/\s*%%.*\n/gm, '\n'); // remove comments from text to avoid issues with parser
|
||||
// eslint-disable-next-line unicorn/better-regex
|
||||
text = text.replace(/\s*%%[^{\ninit].*\n/gm, '\n'); // remove comments from text to avoid issues with parser
|
||||
|
||||
const idSelector = '#' + id;
|
||||
const iFrameID = 'i' + id;
|
||||
|
Loading…
x
Reference in New Issue
Block a user