OpenDocument writer: implement custom-style for spans.

Closes #9657.
This commit is contained in:
John MacFarlane
2024-04-14 11:29:56 -07:00
parent ad6b9dd974
commit bc9f990256
2 changed files with 13 additions and 2 deletions
+6 -2
View File
@@ -660,8 +660,12 @@ inlineToOpenDocument o ils
, ("xlink:show" , "embed" )
, ("xlink:actuate", "onLoad")]
mkSpan attr xs = do
let (ident,_,_) = attr
i = withLangFromAttr attr (inlinesToOpenDocument o xs)
let (ident,_,kvs) = attr
i = maybe id (\sty ->
fmap (inTags False "text:span"
[ ("text:style-name", sty) ]))
(lookup "custom-style" kvs) .
withLangFromAttr attr $ inlinesToOpenDocument o xs
mkBookmarkedSpan b =
if isEmpty b
then selfClosingBookmark ident
+7
View File
@@ -0,0 +1,7 @@
```
% pandoc -t opendocument
[Text here]{custom-style="Strikethrough"}
^D
<text:p text:style-name="Text_20_body"><text:span text:style-name="Strikethrough">Text
here</text:span></text:p>
```