Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow end as a substring of vertex id #224

Merged
merged 1 commit into from
Oct 15, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions dist/mermaid.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)+'">&nbsp';
});

} else {
verticeText = verticeText.replace(/<br>/g, "\n");
labelTypeStr = 'text';
Expand Down Expand Up @@ -38091,10 +38097,6 @@ exports.encodeEntities = function(text){

});

//txt = txt.replace(/fa:fa[\w\-]+/g,function(s,t,u){
// return 'fa:¢';
//});

return txt;
};

Expand Down
2 changes: 1 addition & 1 deletion dist/mermaid.min.js

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions dist/mermaid.slim.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)+'">&nbsp';
});

} else {
verticeText = verticeText.replace(/<br>/g, "\n");
labelTypeStr = 'text';
Expand Down Expand Up @@ -28875,10 +28881,6 @@ exports.encodeEntities = function(text){

});

//txt = txt.replace(/fa:fa[\w\-]+/g,function(s,t,u){
// return 'fa:¢';
//});

return txt;
};

Expand Down
2 changes: 1 addition & 1 deletion dist/mermaid.slim.min.js

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions dist/mermaidAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)+'">&nbsp';
});

} else {
verticeText = verticeText.replace(/<br>/g, "\n");
labelTypeStr = 'text';
Expand Down Expand Up @@ -37376,10 +37382,6 @@ exports.encodeEntities = function(text){

});

//txt = txt.replace(/fa:fa[\w\-]+/g,function(s,t,u){
// return 'fa:¢';
//});

return txt;
};

Expand Down
12 changes: 7 additions & 5 deletions dist/mermaidAPI.slim.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/mermaidAPI.slim.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/diagrams/flowchart/parser/flow.jison
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/diagrams/flowchart/parser/flow.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions src/diagrams/flowchart/parser/flow.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;');

Expand Down