diff --git a/components/Editor.js b/components/Editor.js index fb3540f..4279f93 100644 --- a/components/Editor.js +++ b/components/Editor.js @@ -180,7 +180,13 @@ class Editor extends React.Component { return ( domtoimage .toSvg(node, config) - .then(dataUrl => dataUrl.replace(/ /g, ' ')) + .then(dataUrl => + dataUrl + .replace(/ /g, ' ') + // https://github.com/tsayen/dom-to-image/blob/fae625bce0970b3a039671ea7f338d05ecb3d0e8/src/dom-to-image.js#L551 + .replace(/%23/g, '#') + .replace(/%0A/, '\n') + ) // https://stackoverflow.com/questions/7604436/xmlparseentityref-no-name-warnings-while-loading-xml-into-a-php-file .then(dataUrl => dataUrl.replace(/&(?!#?[a-z0-9]+;)/g, '&')) .then(uri => uri.slice(uri.indexOf(',') + 1))