Fix relatwed to issue number #54 - % in text
This commit is contained in:
parent
d0428d492b
commit
6612b3e01e
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -9,7 +9,7 @@ describe('when parsing an info graph it',function() {
|
|||
parseError = function(err, hash) {
|
||||
console.log('Syntax error:' + err);
|
||||
};
|
||||
ex.yy.parseError = parseError;
|
||||
//ex.yy.parseError = parseError;
|
||||
});
|
||||
|
||||
it('should handle an info definition', function () {
|
||||
|
@ -22,4 +22,15 @@ describe('when parsing an info graph it',function() {
|
|||
|
||||
ex.parse(str);
|
||||
});
|
||||
|
||||
it('should handle an showMessage statement definition', function () {
|
||||
var str = 'info\nshowInfo';
|
||||
|
||||
try{
|
||||
ex.parse(str);
|
||||
}
|
||||
catch(err){
|
||||
console.log('Caught'+err.message);
|
||||
}
|
||||
});
|
||||
});
|
|
@ -21,3 +21,6 @@ exports.getInfo = function(){
|
|||
return info;
|
||||
};
|
||||
|
||||
exports.parseError = function(err,hash){
|
||||
mermaid.parseError(err,hash);
|
||||
};
|
|
@ -188,7 +188,11 @@ exports.getClasses = function (text, isDot) {
|
|||
parser.yy = graph;
|
||||
|
||||
// Parse the graph definition
|
||||
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
|
||||
try{
|
||||
|
||||
parser.parse(text);
|
||||
}
|
||||
catch(err){
|
||||
|
||||
}
|
||||
|
||||
// Fetch the default direction, use TD if none was found
|
||||
var dir;
|
||||
|
@ -418,3 +428,4 @@ exports.draw = function (text, id,isDot) {
|
|||
});
|
||||
},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
|
@ -78,7 +78,7 @@ exports.addNote = function (actor, placement, message){
|
|||
|
||||
|
||||
exports.parseError = function(err,hash){
|
||||
console.log('Syntax error:' + err);
|
||||
mermaid.parseError(err,hash);
|
||||
};
|
||||
|
||||
exports.apply = function(param){
|
||||
|
|
|
@ -246,7 +246,12 @@ module.exports.setConf = function(cnf){
|
|||
module.exports.draw = function (text, id) {
|
||||
sq.yy.clear();
|
||||
//console.log(text);
|
||||
try{
|
||||
sq.parse(text+'\n');
|
||||
}
|
||||
catch(err){
|
||||
|
||||
}
|
||||
exports.bounds.init();
|
||||
var diagram = d3.select('#'+id);
|
||||
|
||||
|
|
|
@ -112,6 +112,10 @@ global.mermaid = {
|
|||
},
|
||||
getParser:function(){
|
||||
return flow.parser;
|
||||
},
|
||||
parseError:function(err,hash){
|
||||
console.log('Mermaid Syntax error:');
|
||||
console.log(err);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -27,6 +27,13 @@
|
|||
<link rel="stylesheet" href="seq.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Issue </h1>
|
||||
<div class="mermaid">
|
||||
graph TD
|
||||
question1{Gas tank less than 1/8?}
|
||||
action1[Fill tank to 100%]
|
||||
question1-- Yes -->action1
|
||||
</div>
|
||||
<h1>Shapes</h1>
|
||||
<div class="mermaid">
|
||||
graph TD;
|
||||
|
|
Loading…
Reference in New Issue