From: Pum Walters <pum.walters-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Skip inlines that are also captured in other constructs such as Quoted
Date: Sat, 11 Dec 2021 07:41:06 -0800 (PST) [thread overview]
Message-ID: <55a93bab-31ed-41a2-bfd1-bcad213154f6n@googlegroups.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 1224 bytes --]
I'm writing a filter to process Hugo <https://gohugo.io/> 'shortcodes'
(templates) which typically look like
{{<highlight prolog "linenos = false">}}
1 eqnc(N,ok,eos,eos,Cc,Id1,Id2,L) = lst(Id2,L);
2 eqnc(zero,ok,str(C1,S2),str(C2,S2),Cc,Id1,Id2,L)
= eqnc(zero,eq(C1,C2),S1,S2,Cc,Id1,Id2,L);
...
{{</highlight>}}
A shortcode can have zero or more arguments and a body; the arguments may
include quoted strings such as above. Currently I capture the arguments and
body to be processed at the closing tag. The constituents of the quoted
string trigger `Inline` ('linenos', '=' and 'false'), and after that
`Quoted` is triggered.
My current attempt is to store all inlines, and to drop them when Quoted is
triggered. But it seems weird.
Is there a better way to skip the all constituent Inlines?
--
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/55a93bab-31ed-41a2-bfd1-bcad213154f6n%40googlegroups.com.
[-- Attachment #1.2: Type: text/html, Size: 1810 bytes --]
reply other threads:[~2021-12-11 15:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55a93bab-31ed-41a2-bfd1-bcad213154f6n@googlegroups.com \
--to=pum.walters-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).