From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30603 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Shane Liesegang Newsgroups: gmane.text.pandoc Subject: How to tell an Inlines object from a table in a Lua filter? Date: Mon, 23 May 2022 23:30:40 -0700 (PDT) Message-ID: <84bdd685-384d-4fc4-bee5-75344028f42fn@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_194_1955413500.1653373840873" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6228"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBC2OTJELV4GRBEPXWGKAMGQED5Y6AOI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue May 24 08:30:45 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oa1-f56.google.com ([209.85.160.56]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ntO45-0001Vk-A2 for gtp-pandoc-discuss@m.gmane-mx.org; Tue, 24 May 2022 08:30:45 +0200 Original-Received: by mail-oa1-f56.google.com with SMTP id 586e51a60fabf-e2b879af65sf8846503fac.20 for ; Mon, 23 May 2022 23:30:45 -0700 (PDT) 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=NbVPENY4fy9sqmXluxby+KumfhMsj3KIZ7CDQAALWpM=; b=cJ5Sj+Nn5/WLS04h8u5TvdMFenFtvfRfnC6rjtKQ5EFRpsn+GUXUjy8cReF7Qn1O62 MkVd1mXrKU67HygL8t4lG8PBxUob0Wah+W7FQWVE06QcEmdLhIJC+IgUXv0Pw+oNZgCG BgklkI+2JUvSDS7eN4pEhOGll3uDmUdtrs3hDk46RrOd14JkTn5sug++kGmU2vc6YdSm i8jF90Na6bjX6L6BocrERbIiRUafWVY3Zw0RDjHO69u2EtQXzFxmoh69TvG/ij6gP8Me mBWrta/1kUqoZjuMgMayenf9fHtMDzn0mKrysVZSDS1DYUjHj1iVaMOg9eTn0FwybT7T IEvQ== 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=NbVPENY4fy9sqmXluxby+KumfhMsj3KIZ7CDQAALWpM=; b=pRH8kSJsk/JFIXVMk/5+Vd9iCyMMWqOIotJ8k+xm+RaCgg0G0zAhziz5ceZVEbHp/V dF6hhiLVfMFE/+Y8fS1t1w4lYejICBzDvayPfyNOaRAHUUmn/6fQ1AtOJ02cDvDeZ5hz D6WcR01Ynd7Lg9vJV4IEyULI4fXVmQ1QRk4l9kOZsReUpfwZJWBWeN7mLmG/M2+Lh60K dPLU+BwzYs1/D4w7TjGnmMm8rtmtmKdEnt+EUXyIkltILbQa1MNSBZhpj8Z4UpXn8l+W Gse7E7alYr2oS5nSrNp++q42xOznvrBL42n9m8jNhShop3Fkq7vLA1AAozCfujueojVH xfGw== 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=NbVPENY4fy9sqmXluxby+KumfhMsj3KIZ7CDQAALWpM=; b=xAmZvkVVGSYz7JqJPmXN7rMGeSDB/FDYKfCe2i12osCboe1oojE5NFE2BjCgCc+prg w7Es2yoirBZt1fyjbz1Uc9qG7x/ciN/iXHgmKTzc2zW+gFIe2InSAN9rEeSjKWPpYeA6 F5yozby3zdowOGbFMJ7v5HRKAgMMyE5B6tVAbibaiR4KP/1JTY76tinoGpcljoh9Cl9y kzY7V5qIiCplPRcH+K4QF25US/7OxjCdQumBgM2S0txGoNZB6zfFPA3F7sfJypVBBxmZ ohxMhUtapdUR6HjcjsyBlH2gkbGzTg3eU5JscQ6r9OXisb3a31lmWqtT1EzE4/VeH2jk kddA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM533IEmz0PNLALAtBRDGSkqF13V6FNVAvnQIE6GgHWfRHQ/lgLgbE sN8qbEn70oQWVby1V9zrOwc= X-Google-Smtp-Source: ABdhPJx+gb3mOul/zKkek0gL/4pQ7DtxbceipR411Xa85oAj/1BfngjTI0BjHTKF5r4YC7eSc2SKOQ== X-Received: by 2002:a05:6870:51c9:b0:dd:ab37:c358 with SMTP id b9-20020a05687051c900b000ddab37c358mr1522549oaj.173.1653373844205; Mon, 23 May 2022 23:30:44 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6870:9a03:b0:e2:adb7:ef12 with SMTP id fo3-20020a0568709a0300b000e2adb7ef12ls6064682oab.10.gmail; Mon, 23 May 2022 23:30:41 -0700 (PDT) X-Received: by 2002:a05:6870:46ac:b0:f1:aba1:231 with SMTP id a44-20020a05687046ac00b000f1aba10231mr1615684oap.289.1653373841463; Mon, 23 May 2022 23:30:41 -0700 (PDT) X-Original-Sender: liesegang-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:30603 Archived-At: ------=_Part_194_1955413500.1653373840873 Content-Type: multipart/alternative; boundary="----=_Part_195_1814333674.1653373840873" ------=_Part_195_1814333674.1653373840873 Content-Type: text/plain; charset="UTF-8" Is there a way to tell whether a given object is a pandoc.Inlines as opposed to a plain Lua table? When I call `type(obj)` on it, it just returns "table." I note that if I print it, it shows "Inlines:" instead of "table:" but is there any smarter way to determine? I see some code in the Lua filters example repository that does this kind of check, but I don't know if it's crucial to that code or not, if something has changed recently, etc. (My use case here is walking through my Meta object and building something that will get passed to different functions -- if it encounters a nested table of data, I need to recurse, but if it's an Inlines object, I want to stringify it.) -- 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/84bdd685-384d-4fc4-bee5-75344028f42fn%40googlegroups.com. ------=_Part_195_1814333674.1653373840873 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Is there a way to tell whether a given object is a pandoc.Inlines as o= pposed to a plain Lua table? When I call `type(obj)` on it, it just returns= "table." I note that if I print it, it shows "Inlines:" instead of "table:= " but is there any smarter way to determine?

= I see so= me code in the Lua filters example repository that does this kind of ch= eck, but I don't know if it's crucial to that code or not, if something has= changed recently, etc.

(My use case here is = walking through my Meta object and building something that will get passed = to different functions -- if it encounters a nested table of data, I need t= o recurse, but if it's an Inlines object, I want to stringify it.) 

--
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/84bdd685-384d-4fc4-bee5-75344028f42fn%40googlegroups.= com.
------=_Part_195_1814333674.1653373840873-- ------=_Part_194_1955413500.1653373840873--