Merge pull request #224 from spect88/fix-end-substring
Allow `end` as a substring of vertex id
This commit is contained in:
commit
e0033965bc
|
@ -32062,9 +32062,15 @@ exports.addVertices = function (vert, g) {
|
|||
verticeText = vertice.text;
|
||||
}
|
||||
|
||||
|
||||
|
||||
var labelTypeStr = '';
|
||||
if(conf.htmlLabels) {
|
||||
labelTypeStr = 'html';
|
||||
verticeText = verticeText.replace(/fa:fa[\w\-]+/g,function(s,t,u){
|
||||
return '<i class="fa '+ s.substring(3)+'"> ';
|
||||
});
|
||||
|
||||
} else {
|
||||
verticeText = verticeText.replace(/<br>/g, "\n");
|
||||
labelTypeStr = 'text';
|
||||
|
@ -38091,10 +38097,6 @@ exports.encodeEntities = function(text){
|
|||
|
||||
});
|
||||
|
||||
//txt = txt.replace(/fa:fa[\w\-]+/g,function(s,t,u){
|
||||
// return 'fa:¢';
|
||||
//});
|
||||
|
||||
return txt;
|
||||
};
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -22846,9 +22846,15 @@ exports.addVertices = function (vert, g) {
|
|||
verticeText = vertice.text;
|
||||
}
|
||||
|
||||
|
||||
|
||||
var labelTypeStr = '';
|
||||
if(conf.htmlLabels) {
|
||||
labelTypeStr = 'html';
|
||||
verticeText = verticeText.replace(/fa:fa[\w\-]+/g,function(s,t,u){
|
||||
return '<i class="fa '+ s.substring(3)+'"> ';
|
||||
});
|
||||
|
||||
} else {
|
||||
verticeText = verticeText.replace(/<br>/g, "\n");
|
||||
labelTypeStr = 'text';
|
||||
|
@ -28875,10 +28881,6 @@ exports.encodeEntities = function(text){
|
|||
|
||||
});
|
||||
|
||||
//txt = txt.replace(/fa:fa[\w\-]+/g,function(s,t,u){
|
||||
// return 'fa:¢';
|
||||
//});
|
||||
|
||||
return txt;
|
||||
};
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -31729,9 +31729,15 @@ exports.addVertices = function (vert, g) {
|
|||
verticeText = vertice.text;
|
||||
}
|
||||
|
||||
|
||||
|
||||
var labelTypeStr = '';
|
||||
if(conf.htmlLabels) {
|
||||
labelTypeStr = 'html';
|
||||
verticeText = verticeText.replace(/fa:fa[\w\-]+/g,function(s,t,u){
|
||||
return '<i class="fa '+ s.substring(3)+'"> ';
|
||||
});
|
||||
|
||||
} else {
|
||||
verticeText = verticeText.replace(/<br>/g, "\n");
|
||||
labelTypeStr = 'text';
|
||||
|
@ -37376,10 +37382,6 @@ exports.encodeEntities = function(text){
|
|||
|
||||
});
|
||||
|
||||
//txt = txt.replace(/fa:fa[\w\-]+/g,function(s,t,u){
|
||||
// return 'fa:¢';
|
||||
//});
|
||||
|
||||
return txt;
|
||||
};
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -21,7 +21,7 @@
|
|||
"click" return 'CLICK';
|
||||
"graph" return 'GRAPH';
|
||||
"subgraph" return 'subgraph';
|
||||
"end"\s* return 'end';
|
||||
"end"\b\s* return 'end';
|
||||
"LR" return 'DIR';
|
||||
"RL" return 'DIR';
|
||||
"TB" return 'DIR';
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -308,6 +308,18 @@ describe('when parsing ',function(){
|
|||
expect(edges[0].text).toBe('');
|
||||
});
|
||||
|
||||
it('should handle node names with "end" substring',function(){
|
||||
var res = flow.parser.parse('graph TD\nendpoint --> sender');
|
||||
|
||||
var vert = flow.parser.yy.getVertices();
|
||||
var edges = flow.parser.yy.getEdges();
|
||||
|
||||
expect(vert['endpoint'].id).toBe('endpoint');
|
||||
expect(vert['sender'].id).toBe('sender');
|
||||
expect(edges[0].start).toBe('endpoint');
|
||||
expect(edges[0].end).toBe('sender');
|
||||
});
|
||||
|
||||
it('should handle open ended edges',function(){
|
||||
var res = flow.parser.parse('graph TD;A---B;');
|
||||
|
||||
|
|
Loading…
Reference in New Issue