diff options
| author | John MacFarlane <[email protected]> | 2024-02-09 11:59:26 -0800 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2024-02-09 16:39:48 -0800 |
| commit | 0604fa297dfdacf32cd8360a0c48651e45c9e566 (patch) | |
| tree | a3a2fa3f175067e7ba4c0811eaa365a802707ae4 /src | |
| parent | ea23868ae46aa7677c9e0d74d892cd8dea628b1f (diff) | |
Fix id replacements in SVGs with clipping paths.
This fixes `--embed-resources` when SVGs have `clip-path`
attributes.
Closes #9420.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Text/Pandoc/SelfContained.hs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Text/Pandoc/SelfContained.hs b/src/Text/Pandoc/SelfContained.hs index 54d49127a..ddb44385a 100644 --- a/src/Text/Pandoc/SelfContained.hs +++ b/src/Text/Pandoc/SelfContained.hs @@ -185,6 +185,10 @@ convertTags (t@(TagOpen tagname as):ts) case T.uncons x of Just ('#', x') -> (k, "#" <> svgid <> "_" <> x') _ -> (k, x) + addIdPrefix ("clip-path", x) = ("clip-path", + case T.stripPrefix "url(#" x of + Just x' -> "url(#" <> svgid <> "_" <> x' + Nothing -> x) addIdPrefix kv = kv let ensureUniqueId (TagOpen tname ats) = TagOpen tname (map addIdPrefix ats) |
