mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-14 21:09:50 +02:00
Merge pull request #957 from GDFaber/master
Flowchart parsing issue with CRLF #894
This commit is contained in:
13
dist/index.html
vendored
13
dist/index.html
vendored
@@ -439,5 +439,18 @@ Class08 <--> C2: Cool label
|
||||
}, 100)
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
const testLineEndings = (test, input) => {
|
||||
try {
|
||||
mermaid.render(test, input, () => {});
|
||||
} catch (err) {
|
||||
console.error("Error in %s:\n\n%s", test, err);
|
||||
}
|
||||
};
|
||||
|
||||
testLineEndings("CR", "graph LR\rsubgraph CR\rA --> B\rend");
|
||||
testLineEndings("LF", "graph LR\nsubgraph LF\nA --> B\nend");
|
||||
testLineEndings("CRLF", "graph LR\r\nsubgraph CRLF\r\nA --> B\r\nend");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -169,7 +169,7 @@
|
||||
"{" return 'DIAMOND_START'
|
||||
"}" return 'DIAMOND_STOP'
|
||||
"\"" return 'QUOTE';
|
||||
\n+ return 'NEWLINE';
|
||||
(\r|\n|\r\n)+ return 'NEWLINE';
|
||||
\s return 'SPACE';
|
||||
<<EOF>> return 'EOF';
|
||||
|
||||
|
Reference in New Issue
Block a user