Added textLength and lengthAdjust to text formatting tools

This commit is contained in:
Timo Dittmann
2021-01-26 11:06:13 +01:00
committed by JFH
parent 69bf3d9d81
commit 41fc05672d
70 changed files with 553 additions and 60 deletions

View File

@@ -56,4 +56,24 @@ describe('sanitize', function () {
assert.equal(text.getAttribute('word-spacing'), '10');
});
it('Test sanitizeSvg() does not strip textLength attribute from text', function () {
const text = document.createElementNS(NS.SVG, 'text');
text.setAttribute('textLength', '200');
svg.append(text);
sanitize.sanitizeSvg(text);
assert.equal(text.getAttribute('textLength'), '200');
});
it('Test sanitizeSvg() does not strip lengthAdjust attribute from text', function () {
const text = document.createElementNS(NS.SVG, 'text');
text.setAttribute('lengthAdjust', 'spacingAndGlyphs');
svg.append(text);
sanitize.sanitizeSvg(text);
assert.equal(text.getAttribute('lengthAdjust'), 'spacingAndGlyphs');
});
});