Merge pull request #957 from GDFaber/master

Flowchart parsing issue with CRLF #894
This commit is contained in:
Nacho 2019-09-27 09:12:19 -04:00 committed by GitHub
commit f49bae6622
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

13
dist/index.html vendored
View File

@ -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>

View File

@ -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';