JavaScript
0
Вклад в тег
const oldSvg = data.editor.svg;
const newSvg = svg.trim()
.replace(/(^<\?xml[^>]*>)|/g, '')
.trim()
.replace(/(^<svg[^>]*>)|(<\/svg>$)/g, '');
const position = oldSvg.length - 6;
const svgResult = [oldSvg.slice(0, position), newSvg, oldSvg.slice(position)].join('');