feat(extra-features): Use word boundary to avoid matching patrial attr.
(e.g., width vs stroke-width)
This commit is contained in:
@ -245,7 +245,7 @@ class SmartyHelperFunctions
|
|||||||
$value = $params[$attr];
|
$value = $params[$attr];
|
||||||
|
|
||||||
// Check if attribute already exists in the SVG
|
// Check if attribute already exists in the SVG
|
||||||
if (preg_match('/' . preg_quote($attr) . '="[^"]*"/', $svg_content)) {
|
if (preg_match('/\b' . preg_quote($attr) . '="[^"]*"/', $svg_content)) {
|
||||||
// Replace existing attribute
|
// Replace existing attribute
|
||||||
$svg_content = preg_replace(
|
$svg_content = preg_replace(
|
||||||
'/' . preg_quote($attr) . '="[^"]*"/',
|
'/' . preg_quote($attr) . '="[^"]*"/',
|
||||||
|
|||||||
Reference in New Issue
Block a user