mirror of
https://github.com/svg/svgo.git
synced 2025-08-07 15:22:54 +03:00
Add xmlns:xlink in reusePaths plugin (#1555)
Ref https://github.com/svg/svgo/issues/1200
This commit is contained in:
@@ -101,6 +101,9 @@ exports.fn = () => {
|
||||
}
|
||||
}
|
||||
if (defsTag.children.length !== 0) {
|
||||
if (node.attributes['xmlns:xlink'] == null) {
|
||||
node.attributes['xmlns:xlink'] = 'http://www.w3.org/1999/xlink';
|
||||
}
|
||||
node.children.unshift(defsTag);
|
||||
}
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@
|
||||
|
||||
@@@
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<defs>
|
||||
<path id="test0" d="M 10,50 l 20,30 L 20,30"/>
|
||||
<path d="M 10,50 c 20,30 40,50 60,70 C 20,30 40,50 60,70" id="reuse-0"/>
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.4 KiB |
@@ -9,7 +9,7 @@
|
||||
|
||||
@@@
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<defs>
|
||||
<path id="test0" d="M 10,50 l 20,30 L 20,30"/>
|
||||
<path id="test2" stroke="blue" d="M 10,50 l 20,30 L 20,30"/>
|
||||
|
Before Width: | Height: | Size: 909 B After Width: | Height: | Size: 952 B |
Reference in New Issue
Block a user