#4446 Improved regular expression

This commit is contained in:
Knut Sveidqvist
2023-06-01 17:39:54 +02:00
parent 7b6cb4f974
commit 55092f532f
2 changed files with 8 additions and 5 deletions

View File

@@ -263,7 +263,10 @@ export const cleanUpSvgCode = (
// Replace marker-end urls with just the # anchor (remove the preceding part of the URL)
if (!useArrowMarkerUrls && !inSandboxMode) {
cleanedUpSvg = cleanedUpSvg.replace(/marker-end="url\([/:A-Za-z-]*?#/g, 'marker-end="url(#');
cleanedUpSvg = cleanedUpSvg.replace(
/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,
'marker-end="url(#'
);
}
cleanedUpSvg = decodeEntities(cleanedUpSvg);