parent
14850f753f
commit
698167783b
|
@ -21,7 +21,7 @@ function getSvgContents(diagram) {
|
||||||
var outerNode = paper.node.parentNode;
|
var outerNode = paper.node.parentNode;
|
||||||
|
|
||||||
var svg = outerNode.innerHTML;
|
var svg = outerNode.innerHTML;
|
||||||
return svg.replace(/^<svg[^>]>|<\/svg>$/, '');
|
return svg.replace(/^<svg[^>]*>|<\/svg>$/g, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
function initListeners(diagram, listeners) {
|
function initListeners(diagram, listeners) {
|
||||||
|
@ -123,9 +123,8 @@ Viewer.prototype.saveXML = function(options, done) {
|
||||||
var SVG_HEADER =
|
var SVG_HEADER =
|
||||||
'<?xml version="1.0" encoding="utf-8"?>\n' +
|
'<?xml version="1.0" encoding="utf-8"?>\n' +
|
||||||
'<!-- created with bpmn-js / http://bpmn.io -->\n' +
|
'<!-- created with bpmn-js / http://bpmn.io -->\n' +
|
||||||
'<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">\n' +
|
'<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n' +
|
||||||
'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" ' +
|
'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">\n';
|
||||||
'version="1.1" baseProfile="basic">\n';
|
|
||||||
|
|
||||||
var SVG_FOOTER = '</svg>';
|
var SVG_FOOTER = '</svg>';
|
||||||
|
|
||||||
|
|
|
@ -107,6 +107,9 @@ describe('Viewer', function() {
|
||||||
// ensure correct rendering of SVG contents
|
// ensure correct rendering of SVG contents
|
||||||
expect(svg.indexOf('undefined')).toBe(-1);
|
expect(svg.indexOf('undefined')).toBe(-1);
|
||||||
|
|
||||||
|
// expect header to be written only once
|
||||||
|
expect(svg.indexOf('<svg width="100%" height="100%">')).toBe(-1);
|
||||||
|
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue