mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-15 06:19:24 +02:00
fix: allow colons in events
This commit is contained in:
@@ -29,7 +29,7 @@ accDescr\s*"{"\s* { this.begin("acc_descr_multili
|
||||
"section"\s[^:\n]+ return 'section';
|
||||
|
||||
// event starting with "==>" keyword
|
||||
":"\s[^:\n]+ return 'event';
|
||||
":"\s(?:[^#:\n;]|":"(?!\s))+ return 'event';
|
||||
[^#:\n]+ return 'period';
|
||||
|
||||
|
||||
|
@@ -75,6 +75,30 @@ describe('when parsing a timeline ', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('should handle a section, and task and its events including markdown link', function () {
|
||||
let str = `timeline
|
||||
section abc-123
|
||||
task1: [event1](http://example.com)
|
||||
task2: event2: event3
|
||||
`;
|
||||
timeline.parse(str);
|
||||
expect(timelineDB.getSections()[0]).to.deep.equal('abc-123');
|
||||
timelineDB.getTasks().forEach((t) => {
|
||||
switch (t.task.trim()) {
|
||||
case 'task1':
|
||||
expect(t.events).to.deep.equal(['[event1](http://example.com)']);
|
||||
break;
|
||||
|
||||
case 'task2':
|
||||
expect(t.events).to.deep.equal(['event2', 'event3']);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it('should handle a section, and task and its multi line events', function () {
|
||||
let str = `timeline
|
||||
section abc-123
|
||||
|
Reference in New Issue
Block a user