mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-10 09:39:38 +02:00
Merge branch 'develop' into 1252_gitgraph_reinvented
This commit is contained in:
@@ -746,7 +746,7 @@ foo()
|
||||
parser.parse(str);
|
||||
|
||||
const testClass = parser.yy.getClass('Class1');
|
||||
expect(testClass.link).toBe('about:blank'); //('google.com'); security needs to be set to 'loose' for this to work right
|
||||
expect(testClass.link).toBe('google.com');
|
||||
expect(testClass.cssClasses.length).toBe(1);
|
||||
expect(testClass.cssClasses[0]).toBe('clickable');
|
||||
});
|
||||
@@ -760,7 +760,7 @@ foo()
|
||||
parser.parse(str);
|
||||
|
||||
const testClass = parser.yy.getClass('Class1');
|
||||
expect(testClass.link).toBe('about:blank'); //('google.com'); security needs to be set to 'loose' for this to work right
|
||||
expect(testClass.link).toBe('google.com');
|
||||
expect(testClass.cssClasses.length).toBe(1);
|
||||
expect(testClass.cssClasses[0]).toBe('clickable');
|
||||
});
|
||||
@@ -774,7 +774,7 @@ foo()
|
||||
parser.parse(str);
|
||||
|
||||
const testClass = parser.yy.getClass('Class1');
|
||||
expect(testClass.link).toBe('about:blank'); //('google.com'); security needs to be set to 'loose' for this to work right
|
||||
expect(testClass.link).toBe('google.com');
|
||||
expect(testClass.tooltip).toBe('A tooltip');
|
||||
expect(testClass.cssClasses.length).toBe(1);
|
||||
expect(testClass.cssClasses[0]).toBe('clickable');
|
||||
@@ -789,7 +789,7 @@ foo()
|
||||
parser.parse(str);
|
||||
|
||||
const testClass = parser.yy.getClass('Class1');
|
||||
expect(testClass.link).toBe('about:blank'); //('google.com'); security needs to be set to 'loose' for this to work right
|
||||
expect(testClass.link).toBe('google.com');
|
||||
expect(testClass.tooltip).toBe('A tooltip');
|
||||
expect(testClass.cssClasses.length).toBe(1);
|
||||
expect(testClass.cssClasses[0]).toBe('clickable');
|
||||
|
@@ -93,7 +93,12 @@ const sanitizeMore = (text, config) => {
|
||||
|
||||
export const sanitizeText = (text, config) => {
|
||||
if (!text) return text;
|
||||
const txt = DOMPurify.sanitize(sanitizeMore(text, config));
|
||||
let txt = '';
|
||||
if (config['dompurifyConfig']) {
|
||||
txt = DOMPurify.sanitize(sanitizeMore(text, config), config['dompurifyConfig']);
|
||||
} else {
|
||||
txt = DOMPurify.sanitize(sanitizeMore(text, config));
|
||||
}
|
||||
return txt;
|
||||
};
|
||||
|
||||
|
@@ -139,6 +139,7 @@ export const autoWrap = () => wrapEnabled;
|
||||
export const clear = function () {
|
||||
actors = {};
|
||||
messages = [];
|
||||
sequenceNumbersEnabled = false;
|
||||
};
|
||||
|
||||
export const parseMessage = function (str) {
|
||||
|
@@ -1619,4 +1619,24 @@ participant Alice
|
||||
models.lastActor().y + models.lastActor().height + mermaid.sequence.boxMargin
|
||||
);
|
||||
});
|
||||
it('it should hide sequence numbers when autonumber is removed when autonumber is enabled', function () {
|
||||
const str1 = `
|
||||
sequenceDiagram
|
||||
autonumber
|
||||
Alice->Bob:Hello Bob, how are you?
|
||||
Note right of Bob: Bob thinks
|
||||
Bob-->Alice: I am good thanks!`;
|
||||
|
||||
mermaidAPI.parse(str1);
|
||||
expect(parser.yy.showSequenceNumbers()).toBe(true);
|
||||
|
||||
const str2 = `
|
||||
sequenceDiagram
|
||||
Alice->Bob:Hello Bob, how are you?
|
||||
Note right of Bob: Bob thinks
|
||||
Bob-->Alice: I am good thanks!`;
|
||||
|
||||
mermaidAPI.parse(str2);
|
||||
expect(parser.yy.showSequenceNumbers()).toBe(false);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user