UNPKG

fabric

Version:

Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.

11 lines (8 loc) 428 B
import { reNum } from '../../parser/constants.mjs'; import { normalizeWs } from './normalizeWhiteSpace.mjs'; const regex = new RegExp(`(${reNum})`, 'gi'); const cleanupSvgAttribute = attributeValue => normalizeWs(attributeValue.replace(regex, ' $1 ') // replace annoying commas and arbitrary whitespace with single spaces .replace(/,/gi, ' ')); export { cleanupSvgAttribute }; //# sourceMappingURL=cleanupSvgAttribute.mjs.map