mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-30 12:49:41 +02:00
Fix relatwed to issue number #54 - % in text
This commit is contained in:
@@ -188,7 +188,11 @@ exports.getClasses = function (text, isDot) {
|
||||
parser.yy = graph;
|
||||
|
||||
// Parse the graph definition
|
||||
parser.parse(text);
|
||||
try{
|
||||
parser.parse(text);
|
||||
}
|
||||
catch(err){
|
||||
}
|
||||
|
||||
var classDefStylesObj = {};
|
||||
var classDefStyleStr = '';
|
||||
@@ -222,7 +226,13 @@ exports.draw = function (text, id,isDot) {
|
||||
parser.yy = graph;
|
||||
|
||||
// Parse the graph definition
|
||||
parser.parse(text);
|
||||
try{
|
||||
|
||||
parser.parse(text);
|
||||
}
|
||||
catch(err){
|
||||
|
||||
}
|
||||
|
||||
// Fetch the default direction, use TD if none was found
|
||||
var dir;
|
||||
@@ -417,4 +427,5 @@ exports.draw = function (text, id,isDot) {
|
||||
i = i + 1;
|
||||
});
|
||||
},200);
|
||||
};
|
||||
};
|
||||
|
||||
|
@@ -235,3 +235,7 @@ exports.addSubGraph = function (list, title) {
|
||||
exports.getSubGraphs = function (list) {
|
||||
return subGraphs;
|
||||
};
|
||||
|
||||
exports.parseError = function(err,hash){
|
||||
mermaid.parseError(err,hash);
|
||||
};
|
@@ -389,7 +389,7 @@ styleComponent: ALPHA | COLON | MINUS | NUM | UNIT | SPACE | HEX | BRKT | DOT |
|
||||
|
||||
commentToken : textToken | graphCodeTokens ;
|
||||
|
||||
textToken : textNoTagsToken | TAGSTART | TAGEND | '==' | '--' ;
|
||||
textToken : textNoTagsToken | TAGSTART | TAGEND | '==' | '--' | PCT ;
|
||||
|
||||
textNoTagsToken: alphaNumToken | SPACE | MINUS | keywords ;
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user