I find in Lua filters that I sometimes would like to know whether or not I'm in a footnote. Currently, I'm trying to move punctuation before footnotes. Given my citation style, I know that a Cite in body text will produce a footnote, while a Cite in a footnote will not. So I want to move punctuation before a Cite when it's not in a footnote. Since a filter function for Inlines will descend into footnotes as well, there doesn't seem to be any way to tell when the Cite is in a footnote.

In this particular case, I can work around the limitation because any Cite in a footnote will either be the first element or will have a Space before it. So with that assumption, I can look for the last innermost element before the Cite and check its type: if it's a Str,  can append the punctuation to it and delete the punctuation from where it was. if it's a Space, I do nothing, because I must be in a footnote. However, at least in the long term, I'd like to be able to tell whether or not I'm in a footnote.

--
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/111b665a-1b7a-4856-bf37-d96780a07c24n%40googlegroups.com.