Great. Thanks! Den tis 12 juli 2022 12:41Albert Krewinkel skrev: > > BPJ writes: > > > I'm writing a filter which walks a table read from CSV, which are all > > read in as literal strings by Pandoc, and parses them with pandoc.read. > > In order to know which format to read the filter inspects a metadata > > field expecting the value to be the one to pass as second argument to > > pandoc.read. However there is easy way to validate that value before > > calling pandoc.read. To be sure I could create a table mapping every > > name returned by --list-input-formats to `true`, but it would seem that > > rather than every filter which needs this information (and conversely > > output formats for pandoc.write) maintaining its own lookup it would be > > better if the Lua API provided it, either as a pair of functions > > returning true if their argument is a valid format, or as (objects > > which act as) tables (sets) with valid formats mapped to true, which is > > something I assume Pandoc already has provision for internally. Does > > this seem like a good idea, or is my use case with the filter taking > > this info from the user too unusual to warrant this? > > That seems like a good idea to me. I've created a PR: > https://github.com/jgm/pandoc/pull/8177 > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msgid/pandoc-discuss/87y1wyfwbv.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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhAh25W8A2vUYPFzEsy86_bVYBF5jPULPpAiNOTr_PP1PQ%40mail.gmail.com.