From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32594 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: ThomasH Newsgroups: gmane.text.pandoc Subject: Lua Filter: Detect Type of Inlines Date: Fri, 12 May 2023 10:13:46 -0700 (PDT) Message-ID: <4d901ab9-179d-4274-8ce9-fdf36056905fn@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_15926_1985239767.1683911626852" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34135"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCOJJAXZ7EPBBS7H7GRAMGQEG6Q2NEY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri May 12 19:13:51 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ot1-f61.google.com ([209.85.210.61]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pxWL0-0008ha-GD for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 12 May 2023 19:13:50 +0200 Original-Received: by mail-ot1-f61.google.com with SMTP id 46e09a7af769-6aaff95f42esf6344430a34.2 for ; Fri, 12 May 2023 10:13:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20221208; t=1683911629; x=1686503629; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:message-id:to:from:date:sender:from:to:cc :subject:date:message-id:reply-to; bh=f0m8kVj101CHR+KL8VashviukRQ1e262ls/q5rep3Jw=; b=p+QnhSEymHR7kohQxfvCNm7iylGY7NsBFMDTxnbLeINz1KzghZ/4iSXHxxfvMhA1EJ 5+BXlMoihoMX28k9xdyPafHz9GVKmETZn00gOnQcPb++rDuh8jDo8Ns+M5/kZDCQIy61 48GgMl710L6bwnBSix5173hkMB79GT2Pg9EjtjSfYBvDEP8RD8Glu0PocCMTWhjyshRG 4+agWJKqcu1Jr/cBYr0juQWZl5F4fO8CemDIVZgfMnjckby/VCmhU3ZMPOOHuIw7zM+F 7KxSauQEZrhfU5cursB6IFCdpt+h+tYgJkP+mCfWHpTQ627IyLe1q0dboYpkUy/nOZo9 SwVA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683911629; x=1686503629; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:message-id:to:from:date:from:to:cc:subject :date:message-id:reply-to; bh=f0m8kVj101CHR+KL8VashviukRQ1e262ls/q5rep3Jw=; b=AyUTMRi4r8HgSKgAkfcqEs3HWI3cKSWxmvOqfmlG0k41z6Pzha8a683KBJ8+IoSq8R UZ7kinPS5wh3eZ9dzrRa4zBXpVwBRs0r/GEtmYDq6peipubdrChWHRuuxkS7P3o9Vmgp lZRMwLJJ3cOs4Q7I/lDJVmY1/TNM2vipoSGfDlzrAqfvRIRzLbeMiFXVhjvDIyvwFTgM pvifO1FstYcSdrtdM+coCNwXFl8UkA+xHZFuJhYcESe1C3g7YrD3rQBqeUuJej0Jp8QZ C/toKUciQlQUbt2cVehoWZXv13JFe599MnP2TlnsC1YCyuh5UPFgFrssDLJd5DGo6W0u x9pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683911629; x=1686503629; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-sender:mime-version:subject:message-id:to:from:date :x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=f0m8kVj101CHR+KL8VashviukRQ1e262ls/q5rep3Jw=; b=RRPD5Z+AoDp/8w6pFR1ewvrf+TCJ1pUKpcPFGi6O3ElcNOYLibOKwQxALghQwixrVH v+JkT6i0ONia4KW+kIm09F3Z6Btf+/OJKAsC5jxQeO4ftYRKliuJQj5JOhAzj+yNWbKb rM+5zKLwcnl0j4EsiUJGS36Sfeo6X7y+mclF9GcETfKzoyXwuKshp0FdtNA6vq6BeCDs PW++VtIoZC70T5kIfVqYbs4yAXtlRUqD9LhpQmJEsF1aV0ayjp5mrWgA7bAcueh37nv+ HTB4tN4mFFS1OTWdXSiZphECc+Jz3OnM+GSfG513fqYdvtrM4DixF+warxb+4wFvHv4f Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AC+VfDxu7yWsf3jbAwn9Y3EplKGn1IkNpylo00mPQRcaedVuW6T4vZJQ C/hrgLZ8wAjrjcqisX6p21o= X-Google-Smtp-Source: ACHHUZ5odhiWERLPJkN87ES4gFTJiKSX1s/NWcYyBQPx0/jTRsMP2xH/y0epL/uFfa5mFze83cAUWQ== X-Received: by 2002:a9d:65d5:0:b0:6a9:770c:7d26 with SMTP id z21-20020a9d65d5000000b006a9770c7d26mr3799878oth.4.1683911629415; Fri, 12 May 2023 10:13:49 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6870:ac86:b0:192:8bb2:a874 with SMTP id ns6-20020a056870ac8600b001928bb2a874ls8992593oab.9.-pod-prod-gmail; Fri, 12 May 2023 10:13:47 -0700 (PDT) X-Received: by 2002:a05:6870:3b1b:b0:187:e0b6:40de with SMTP id gh27-20020a0568703b1b00b00187e0b640demr10326332oab.0.1683911627354; Fri, 12 May 2023 10:13:47 -0700 (PDT) X-Original-Sender: therch-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:32594 Archived-At: ------=_Part_15926_1985239767.1683911626852 Content-Type: multipart/alternative; boundary="----=_Part_15927_2084611610.1683911626852" ------=_Part_15927_2084611610.1683911626852 Content-Type: text/plain; charset="UTF-8" I want to detect the types of the inline elements of a paragraph. I understand there is pandoc.utils.type() that basically does that, but when I run function Para(para) for i = 1,#para.content,1 do print(tostring(pandoc.utils.type(para.content[i]))) end end all that is printed is "Inline" for all elements, not specific types like Str, Span, Link or Image. How can I get at the specific types? Thanks, T. -- 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/4d901ab9-179d-4274-8ce9-fdf36056905fn%40googlegroups.com. ------=_Part_15927_2084611610.1683911626852 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I want to detect the types of the inline elements of a paragraph. I un= derstand there is pandoc.utils.type() that basically does that, but when I = run

function Para(para)
=C2=A0 =C2=A0 for i= =3D 1,#para.content,1 do
=C2=A0 =C2=A0 =C2=A0 =C2=A0 print(tostring(p= andoc.utils.type(para.content[i])))
=C2=A0 =C2=A0 end
end

all that is printed is "Inline" for all elements, not s= pecific types like Str, Span, Link or Image. How can I get at the specific = types?

Thanks,
T.

--
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/4d901ab9-179d-4274-8ce9-fdf36056905fn%40googlegroups.= com.
------=_Part_15927_2084611610.1683911626852-- ------=_Part_15926_1985239767.1683911626852--