Fix id replacements in SVGs with clipping paths.

This fixes `--embed-resources` when SVGs have `clip-path`
attributes.

Closes #9420.
This commit is contained in:
John MacFarlane
2024-02-09 16:39:48 -08:00
parent ea23868ae4
commit 0604fa297d
3 changed files with 26 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
```
% pandoc --embed-resources
![](command/9420.svg)
^D
<p><svg id="svg_e1815ef374a63cf552e4" width="504pt" height="360pt" viewBox="0 0 504 360">
<defs>
<clipPath id="svg_e1815ef374a63cf552e4_clip1-c3ce354c">
<path />
</clipPath>
</defs>
<g clip-path="url(#svg_e1815ef374a63cf552e4_clip1-c3ce354c)" clip-rule="nonzero"></g>
</svg></p>
```
+9
View File
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="504pt" height="360pt" viewBox="0 0 504 360" version="1.1">
<defs>
<clipPath id="clip1-c3ce354c">
<path/>
</clipPath>
</defs>
<g clip-path="url(#clip1-c3ce354c)" clip-rule="nonzero"></g>
</svg>

After

Width:  |  Height:  |  Size: 323 B