BPJ <melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
> What is the proper way to include (reader) extensions with
> `pandoc.read`? Specifically `-tex_math_dollars`,
> `-shortcut_reference_links` and `+four_space_rule`.
>
> I have read the docu but I don't get it, so an example (here and in
> the docu) would be much appreciated!
Extensions have to be passed as part of the format string, e.g.,
pandoc.read(source, 'markdown-tex_math_dollars')
I'm not entirely happy with this, as it means that any extensions passed
via a ReaderOptions object will be ignored.
-- this may seem like it should disable all extensions,
-- but the ReaderOptions `extensions` field is ignored.
-- The default 'markdown' extensions will be used instead.
pandoc.read(src, 'markdown', {extensions = {}})
Ideas to improve this would be most welcome.
I would just change it to not ignore reader options, and throw an error if the format string and the reader options contradict each other (except for empty table = no extensions and no extensions in string = default extensions). And better hurry before someone starts to rely on reader options being ignored! :-)