Fixed a regression in sequence diagram parsing.

Added the parser as the first argument to parseDirective to support custom directive handling (for now delegated within mermaidAPI but should probably discriminate based on type for delegation)
This commit is contained in:
chris moran
2020-07-27 06:50:54 -04:00
parent 38d4b5be1a
commit c4ad95760a
9 changed files with 17 additions and 26 deletions

View File

@@ -116,13 +116,13 @@ Alice->Bob: hi`;
});
it('should handle an init definition with config converted to the proper diagram configuration', function() {
const str = `
%%{init: { 'logLevel': 0, 'theme': 'dark', 'config': {'wrapEnabled': true} } }%%
%%{init: { 'logLevel': 0, 'theme': 'dark', 'config': {'wrap': true} } }%%
sequenceDiagram
Alice->Bob: hi`;
const type = utils.detectType(str);
const init = utils.detectInit(str);
expect(type).toBe('sequence');
expect(init).toEqual({logLevel:0, theme:"dark", sequence: { wrapEnabled: true }});
expect(init).toEqual({logLevel:0, theme:"dark", sequence: { wrap: true }});
});
it('should handle a multiline init definition', function() {
const str = `