jgm/pandocfilters

Format captions with PlantUML

fuhrmanator opened this issue · 2 comments

Using the examples/plantuml.py I would like to use markdown formatting in the caption, e.g.,

```{.plantuml caption="This is *not* the UML your grandmother told you about." #label }

But the *not* is not processed as markdown (to get italics). Is there a way to do this with the filter API?

I worked around this (it's actually not just a problem with PlantUML) by modifying the filters to generate a file, which is then used in the markdown right after with ![here's my markdown caption](file_generated_by_filter.ext){#label}

I also posted a question on stackoverflow.

I created a solution to this by

  1. running pandoc (again) on the caption text to convert it from markdown to the current format.
  2. returning the caption as a RawInline element.

However, I'm not happy with the first step, as it seems broken to invoke pandoc externally when we're already in a filter.

@jgm would you know of a way to perform the markdown-to-X conversion without using another pandoc external command? Does the pandocfilters API need to be extended to do this?