jgm/pandoc

Allow custom-style atttributes for inline elements in OpenDocument / ODT writer

iandol opened this issue · 0 comments

In the manual it states that:

Custom styles can be used in the docx and ICML formats - https://pandoc.org/MANUAL.html#custom-styles

And there is an open issue to add it for ODT: #2106

However, for block-level div elements there is already support for custom-style for OpenDocument. This was added in commit a2ce28f — adding the custom-style to the XML element like so:

::: {custom-style="Comment"}
Text here...
:::
<text:p text:style-name="Comment">Text here...</text:p>

For inline spans the property is identical, and so I suspect the code change should be straightforward:

[Text here...]{custom-style="Strikethrough"}
<text:span text:style-name="Strikeout">Text here...</text:span>

@jgm suggested:

I don't think it would be too hard to add support for inline custom-styles. We'd need to modify the TextStyle to have a constructor like Custom Text.

See the discussion #9656 for context.