public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Elliott Slaughter <elliottslaughter-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Walk all blocks except inside footnotes
Date: Sat, 17 Oct 2015 13:12:36 -0700	[thread overview]
Message-ID: <CAJ9X=kbfnfzLzD3J-yk0VgDCzPzep1fO2STyFnOSmmq14j+SPQ@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1556 bytes --]

Hi,

I am using Text.Pandoc.Walk to transform all blocks of a certain type. This
works great, except that it recurses into blocks contained inside footnotes
and also applies the transformation there, which is not what I want.

What I would like is a way to stop the recursion at footnotes to prevent
them from being transformed, as I have (to the best of my knowledge) no way
to tell that a block is inside a footnote when I'm looking at it. However,
I am struggling to do this within the structure of Text.Pandoc.Walk because
the function provides no mechanisms to direct or abort recursion, and even
if it did, the footnotes themselves are inlines, not blocks.

I know I could write the traversal by hand in Haskell, but is time
consuming and would require much more code. Is there a better alternative?

Thanks in advance.

-- 
Elliott Slaughter

"Don't worry about what anybody else is going to do. The best way to
predict the future is to invent it." - Alan Kay

-- 
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAJ9X%3DkbfnfzLzD3J-yk0VgDCzPzep1fO2STyFnOSmmq14j%2BSPQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #2: Type: text/html, Size: 2190 bytes --]

             reply	other threads:[~2015-10-17 20:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-17 20:12 Elliott Slaughter [this message]
     [not found] ` <CAJ9X=kbfnfzLzD3J-yk0VgDCzPzep1fO2STyFnOSmmq14j+SPQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-10-17 23:25   ` John MacFarlane

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='CAJ9X=kbfnfzLzD3J-yk0VgDCzPzep1fO2STyFnOSmmq14j+SPQ@mail.gmail.com' \
    --to=elliottslaughter-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).