Den mån 19 sep. 2022 14:51Albert Krewinkel <albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org> skrev:

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! :-)



--
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe  e836 388d c0b2 1f63 1124

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/87czbrfrzr.fsf%40zeitkraut.de.

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhApJjnCMghJ61rg6H2U9_zOP3Q%3DRJxHc9E2dFUH0Py%2BSg%40mail.gmail.com.