From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/29586 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: jcr Newsgroups: gmane.text.pandoc Subject: Detectiing footnotes in Lua scripts Date: Wed, 24 Nov 2021 01:49:29 -0800 (PST) Message-ID: <111b665a-1b7a-4856-bf37-d96780a07c24n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_622_725739974.1637747369956" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35116"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDQLFNXWVILBBKUV7CGAMGQEKDKX6HA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Nov 24 10:49:33 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oo1-f55.google.com ([209.85.161.55]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mpouD-0008vb-Mo for gtp-pandoc-discuss@m.gmane-mx.org; Wed, 24 Nov 2021 10:49:33 +0100 Original-Received: by mail-oo1-f55.google.com with SMTP id k1-20020a4a8501000000b0029ac7b9dc82sf1332047ooh.17 for ; Wed, 24 Nov 2021 01:49:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:date:from:to:message-id:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=iw5NwncymVmskcmJf7ODWTAfAeX+8pHSeG/yV3dlmsM=; b=E4k/XQKdJVFenYdUylEvFBRSaTyBSDxB+13Xssja2qPFVsBp6NQQfwcqbQRZoS4b/J DxdvU8O88Kh83mMwjTQqs3ig0h53WlTm3uYm/d0w4L5aOpffi4KB/MM57xA+y5erm1bO ndYF+lYgcXcq/j6o6+zOtm6IIlbXyCBXUSTpowx2QlksgJz+9Qz8PO6a/6LBArINBATu 3vSHPz/M7dD/v3gD5vuLEwX0hI+2VxMlPZLUO9/BoRj70CUGubjtNzrlHFtjZNoHPsc7 9pQ9wOWzFqA7q2fFd1/C98kXGgavQL3x2zI/x8VtUC++WOR40tBSF4rRE+xL9S1xNNOl Nstg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:message-id:subject:mime-version:x-original-sender :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=iw5NwncymVmskcmJf7ODWTAfAeX+8pHSeG/yV3dlmsM=; b=n2ns5J4Ci673/aCjafiwlWgW3GdVvxD7mLUsqggMcw7XwWu85W2KIZETUuLwEAA7bx NKKX9xk/S4fBm6afiP9IccwxwFe8lKEDCoSFYS2Z7yq9/qHoTNMIZeYGDuc28UYWPffl qo8buwklZ8XmOUKx3K3ypR1S/jzWbwP7MLX4fDxwz9XosnJwkb+XHiJO9IR3Rg9e85Bv 0ymr0MlE7Bwl4Qming30vgC4Nnf02alYS0Vf4AwVBdA8HpTKL700zblO99Xs7AVA9VSI 5ApJIQ5Hg09Bc9on3Vw7VCruLIkAX+ZTSnntaElHsfY4+eJnpV/z9FIWIpL3bMI4RON0 Iq6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:date:from:to:message-id:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=iw5NwncymVmskcmJf7ODWTAfAeX+8pHSeG/yV3dlmsM=; b=ldndWvfvYTcq8dfI7RFf1OPCfecf3EbTgn+Ja6wYuuEIJuYc4XrdwguaEgjRtn2LHh K852vo1oEVgnuPKTyX6ywB1nRBEiseR6PqwtFc2Xo33Upuj4SnHNAJaHifdVW2APIVr6 YPFnKA8l+ELtnkLr2c1rGl4neuTr1SYLusg+Mg2w/kusgGItiUnwFdY2e1aCAAG2TtTe HbHzUh8TAKHQvcpfmrg1jxK8E/4Gi6/k4e5aSMLZ96Ahu7lhrJ8gReQ35nIkV3dgxyWu yoi2bMmCsttkXi/85Yc0XrcYHwCkd7HGzazuhacEb2JGAZD5I6hE1EVTc1KVLIwQ/q/x vLSg== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM531y9kUe55GNzMohuKm2pIFW/dwLIGnorwrJiM+/72G0qjan16BA J1m4iQaJ501C9MdG1JFIEOA= X-Google-Smtp-Source: ABdhPJxe4j7wLo8TbjkEWApQhIoHFvnrjAKJbqCI5NVgck/ULk4AVgkDafdKtwMmXyDmJSHi+SeDeg== X-Received: by 2002:aca:1b15:: with SMTP id b21mr4488137oib.64.1637747372156; Wed, 24 Nov 2021 01:49:32 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a9d:bca:: with SMTP id 68ls4787283oth.8.gmail; Wed, 24 Nov 2021 01:49:30 -0800 (PST) X-Received: by 2002:a9d:490c:: with SMTP id e12mr7641029otf.90.1637747370440; Wed, 24 Nov 2021 01:49:30 -0800 (PST) X-Original-Sender: ffi.appdev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:29586 Archived-At: ------=_Part_622_725739974.1637747369956 Content-Type: multipart/alternative; boundary="----=_Part_623_834986170.1637747369956" ------=_Part_623_834986170.1637747369956 Content-Type: text/plain; charset="UTF-8" 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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. ------=_Part_623_834986170.1637747369956 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I find in Lua filters that I sometimes would like to know whether or n= ot I'm in a footnote. Currently, I'm trying to move punctuation before foot= notes. Given my citation style, I know that a Cite in body text will produc= e a footnote, while a Cite in a footnote will not. So I want to move punctu= ation before a Cite when it's not in a footnote. Since a filter function fo= r 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 th= is 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. S= o with that assumption, I can look for the last innermost element before th= e 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 n= othing, 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 &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-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.
------=_Part_623_834986170.1637747369956-- ------=_Part_622_725739974.1637747369956--