mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-14 12:59:46 +02:00
Adding experimental new grammars
This commit is contained in:
14
src/utils.js
14
src/utils.js
@@ -2,10 +2,20 @@
|
||||
* Created by knut on 14-11-23.
|
||||
*/
|
||||
module.exports.detectType = function(text){
|
||||
if(text.match(/^\s*sequenceDiagram/)){
|
||||
console.log('Detected sequenceDiagram syntax');
|
||||
return "sequenceDiagram";
|
||||
}
|
||||
|
||||
if(text.match(/^\s*sequence/)){
|
||||
//console.log('Detected sequence syntax');
|
||||
return "sequence";
|
||||
}
|
||||
else{
|
||||
return "graph";
|
||||
|
||||
if(text.match(/^\s*digraph/)) {
|
||||
console.log('Detected flow syntax');
|
||||
return "dotGraph";
|
||||
}
|
||||
|
||||
return "graph";
|
||||
}
|
Reference in New Issue
Block a user