diff --git a/src/containers/paint-editor.jsx b/src/containers/paint-editor.jsx index 1e2d3ac043..77d15922ae 100644 --- a/src/containers/paint-editor.jsx +++ b/src/containers/paint-editor.jsx @@ -312,6 +312,7 @@ class PaintEditor extends React.Component { canUndo={this.props.shouldShowUndo} canvas={this.state.canvas} colorInfo={this.state.colorInfo} + fixupSvgStringFn={this.props.fixupSvgStringFn} format={this.props.format} image={this.props.image} imageFormat={this.props.imageFormat} @@ -343,6 +344,7 @@ PaintEditor.propTypes = { changeColorToEyeDropper: PropTypes.func, changeMode: PropTypes.func.isRequired, clearSelectedItems: PropTypes.func.isRequired, + fixupSvgStringFn: PropTypes.func, format: PropTypes.oneOf(Object.keys(Formats)), // Internal, up-to-date data format fontInlineFn: PropTypes.func, handleSwitchToBitmap: PropTypes.func.isRequired, diff --git a/src/containers/paper-canvas.jsx b/src/containers/paper-canvas.jsx index 256f864b98..0fdc3d812a 100644 --- a/src/containers/paper-canvas.jsx +++ b/src/containers/paper-canvas.jsx @@ -193,15 +193,11 @@ class PaperCanvas extends React.Component { } importSvg (svg, rotationCenterX, rotationCenterY) { const paperCanvas = this; - // Pre-process SVG to prevent parsing errors (discussion from #213) - // 1. Remove svg: namespace on elements. - svg = svg.split(/<\s*svg:/).join('<'); - svg = svg.split(/<\/\s*svg:/).join(']*>/); - if (svgAttrs && svgAttrs[0].indexOf('xmlns=') === -1) { - svg = svg.replace( - '