diff --git a/plugins/mergePaths.js b/plugins/mergePaths.js
index 6001a1119..ddf874cf5 100644
--- a/plugins/mergePaths.js
+++ b/plugins/mergePaths.js
@@ -18,7 +18,7 @@ export const description = 'merges multiple paths in one if possible';
* @param {ComputedStyles} computedStyle
* @param {string} attName
*/
-function elementHasGradient(element, computedStyle, attName) {
+function elementHasURL(element, computedStyle, attName) {
const style = computedStyle[attName];
if (!style || style.type !== 'static') {
return false;
@@ -99,8 +99,11 @@ export const fn = (root, params) => {
computedStyle['marker-start'] ||
computedStyle['marker-mid'] ||
computedStyle['marker-end'] ||
+ computedStyle['clip-path'] ||
+ computedStyle['mask'] ||
+ computedStyle['mask-image'] ||
['fill', 'filter', 'stroke'].some((attName) =>
- elementHasGradient(child, computedStyle, attName),
+ elementHasURL(child, computedStyle, attName),
)
) {
if (prevPathData) {
diff --git a/test/plugins/mergePaths.11.svg.txt b/test/plugins/mergePaths.11.svg.txt
new file mode 100644
index 000000000..96645b792
--- /dev/null
+++ b/test/plugins/mergePaths.11.svg.txt
@@ -0,0 +1,39 @@
+Don't merge paths with a clip-path (issue #1267).
+
+===
+
+
+
+@@@
+
+
\ No newline at end of file
diff --git a/test/plugins/mergePaths.12.svg.txt b/test/plugins/mergePaths.12.svg.txt
new file mode 100644
index 000000000..faf72aa5b
--- /dev/null
+++ b/test/plugins/mergePaths.12.svg.txt
@@ -0,0 +1,41 @@
+Don't merge paths with a mask (issue #1267).
+
+===
+
+
+
+@@@
+
+
\ No newline at end of file