From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32045 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Albert Krewinkel Newsgroups: gmane.text.pandoc Subject: Re: Lua filter to process chunkedhtml output Date: Fri, 20 Jan 2023 16:46:49 +0100 Message-ID: <87wn5hkxie.fsf@zeitkraut.de> References: <1D22B433-211B-4033-8A63-F637F52B2008@gmail.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6528"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCZJF7XJTILRBYXUVKPAMGQETDEM2DI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Jan 20 16:59:35 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ej1-f63.google.com ([209.85.218.63]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pItnh-0001dD-Jf for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 20 Jan 2023 16:59:33 +0100 Original-Received: by mail-ej1-f63.google.com with SMTP id fx8-20020a170906b74800b00877a89f965asf552713ejb.1 for ; Fri, 20 Jan 2023 07:59:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674230373; cv=pass; d=google.com; s=arc-20160816; b=Whd573yOGIbji50BM6OgPBfsPMGQo1k2q8+BoO/9lprzO4QXtktQ/GJ6EGnbR42Ez1 PCS+0Ure8STzhInniVTZmrMa2CJr08wQPk6LRDxwF4aGY2PcKJ5VeHogPg3ZsuDxeGoT oRrs0fTJnmXuYIPQ0mI/haljDWUFSmOxeT0QfSUsp30+vjObgGTSc8cNVn/G/4HlDw1q DMbNimMhSas5OFoQkPU2VfhxYDS7oBUmUZ9yPT9tep83jEySsSTncEu6czukVBfbINPn TXo99DMaeE1vOHv6/j8yWiea2K+n1SFGfSsik+nIhnTn6w0BDAw1y45Dtx7JRuWHhvzO 7R1A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:mime-version:message-id :in-reply-to:date:subject:to:from:references:sender:dkim-signature; bh=6+WPGRw7I9YM9rjiUrZWAgKUkIDtfI0azI5tY6qwf4k=; b=ZXU57BUzjDBH7YTnmaKHQcrUe/+Qlm1ToLkD85K6HJgVSN3kfnhonlU8r/R8b098B0 Jx1Lu+YzAccYbqyG3h+AmchGz5UvVIZH1DJeDqJEnA2msD+83iE7YtM1IDoPknqJ29jd DFlDPZvpjzJoyxHH4SwFMVs7FkSeqHPq9NyKypRzxSNrXtNH9KxBqc4Lq4SIF6rLCPGf qfATJNWhmcI28Y+LcEnHUl5XElgIQKQwJhrLh71JLSloYWTg1GF0DIGOvwzEWblbhO4v m2rExJIB8P4c1BIxE4V1PqOcAwNOqByvjyYbd0mBErP4gGcHnO1aE5A8/nM/4iVnL5d4 1NSQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 80.241.56.171 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:mime-version :message-id:in-reply-to:date:subject:to:from:references:sender:from :to:cc:subject:date:message-id:reply-to; bh=6+WPGRw7I9YM9rjiUrZWAgKUkIDtfI0azI5tY6qwf4k=; b=KT9qlKOhz1TZbun6utWjY/Yr4fN+rOBPj59cSOAx7LTLG902NYZwwZHc0SmIGFs/o9 zQQMPHpOBCwCckZuXZpMXUCjUl13X0g3IR3gMna+QxLtxPCDPW16vp1ScdT04WHHkTc1 PR8EipWyzePncPkTzfluYu2gXV4JsWoUxLvSXG64q/sMlr0C/+nOmbOn1KmUuAPbLUB4 TB8KgOEH/ofWcltXQXcdbV36CP3bxQFM+EvHjxVzvIgI9jHEDAmSiUFV+DDDtf1tBudu g4GjQ4RbUr/ZKYVxf5pggZzjud0mtgISfqJ1pantX4KZQwHGI1++3Hr9+tY2HQal7I7b 13Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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-authentication-results:x-original-sender:mime-version :message-id:in-reply-to:date:subject:to:from:references :x-gm-message-state:sender:from:to:cc:subject:date:message-id :reply-to; bh=6+WPGRw7I9YM9rjiUrZWAgKUkIDtfI0azI5tY6qwf4k=; b=5z7/AO+C/USpCHJ2gXwh8wSqFdYUdjiXjdiF2ldq2yuEOawAJ4gQLOuMPUUQukWVFy CKjCMJpqcWrYUO7YpKgnwm/P8e209aEjH3cHdp+W+6ceApwFsTV9nuLq55nw3S0tgi1y obyB+mLDUGXVB9jsBeIq3UPL+PL113YeXuTAulPlJ8KawJo3woaSmI4B5iMapUzWg9BM MwwRpdMtGZZmFz0sJMtEN4czSZSEBgp0J3ChulMUj1EllqbXMLvgSD2t0CBzZJccK+t6 R5XvWaGi8CC2Q18rjUKBM4iIaDFjIxQP4QYy0uo6iDa/IB Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AFqh2krX2It/uVIYpSete/ZB+6lbfy0s1OzleUClPcvasU9DfxlYbVjz rvgw3E5MM70hE8siCy+8RGk= X-Google-Smtp-Source: AMrXdXs+e2luIcNcK87I1HigoKjLQ9wYH2ZR9Asq3kYRzWSYxckmMnJ5wxhJv9pM87w3t3Njzri28g== X-Received: by 2002:a17:907:62a2:b0:84d:3541:77 with SMTP id nd34-20020a17090762a200b0084d35410077mr2095136ejc.22.1674230373091; Fri, 20 Jan 2023 07:59:33 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a17:907:b9d9:b0:7ad:9efd:4692 with SMTP id xa25-20020a170907b9d900b007ad9efd4692ls3455104ejc.4.-pod-prod-gmail; Fri, 20 Jan 2023 07:59:29 -0800 (PST) X-Received: by 2002:a17:906:13d3:b0:84d:2fce:f325 with SMTP id g19-20020a17090613d300b0084d2fcef325mr16027849ejc.49.1674230369017; Fri, 20 Jan 2023 07:59:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674230369; cv=none; d=google.com; s=arc-20160816; b=KVdBJVrPld0LysMtUuMhVRKW5rw+UaZ+2JnLYNwFDm86XI0iCBMieqCLq+/58S8ead 6VXmz8j84kQ2YGeANuHSeIcaPeOi6sN5qqaJYEjUwsRO6aR/s1hanLHzJCBWedfVCArE /4H3XPo/BV2Ud068sjABDfDn69p0zEYDhZPx9A8oTk4OgtWp0kk2tuAc11LFmlFWtQkx Ci1SzLrix1seWV/bPAp9O1NglXXQx4zhvql54XF+0qSL11tPT8c1iZmbmxPyHM5Ar1D0 5g7caGukbfID0yAYQCqRlhOM4Emxyv4zqDdltMk9I9P90/gWWHvFYdL7hJgrl2brLc/5 wFqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:message-id:in-reply-to:date:subject:to:from:references; bh=8LdoCYNKualYIC4P8+FyrEhPeIVXaSLfDqucrJX2PQs=; b=O57Lx+AGNasHuKQzYAOWyq+dccx+Qm0Ak6i6rk9EVGraGrJCLrXCbcQY2xe/TGiRXH sxL6J9KWb28VGM64oXFXFinnm00UVNC1dOtV0llnKxsCOHsJFx8JRAooBEc3zhEBYR9F xbzpHJyL7b4bkhx95Uj6T5F5vn9wR/Ki3lgjOOiHYGap7Yhu14hkhjzQmhQiqDkK5bi+ qgJuJ9xvZItwux4/gzOuDES8Y/etAT2LRbbNCg6EStgM7lhdtSHj94raHVpHJOPyzP7J x4o9oHj9SeA4SGxKjzY2Bu45G/aar6wd139nBKVPjhjz34y0d5hVJkCcHP1p8Wzocic1 X5XA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 80.241.56.171 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org Original-Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org. [80.241.56.171]) by gmr-mx.google.com with ESMTPS id og5-20020a1709071dc500b00871d0c97cbbsi734945ejc.0.2023.01.20.07.59.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Jan 2023 07:59:28 -0800 (PST) Received-SPF: pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 80.241.56.171 as permitted sender) client-ip=80.241.56.171; Original-Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4Nz41k45xWz9sbf for ; Fri, 20 Jan 2023 16:59:22 +0100 (CET) In-reply-to: X-Rspamd-Queue-Id: 4Nz41k45xWz9sbf X-Original-Sender: albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 80.241.56.171 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@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:32045 Archived-At: "'William Lupton' via pandoc-discuss" writes: > Re this: > >> Also, I tried to print the value of PANDOC_WRITER_OPTIONS, but > wlupton's logging.lua errors on it (bad argument #1 to 'for iterator' > (table expected, got light userdata)) > > I investigated, and parts of the writer options are "light userdata" > (I hadn't heard of that). I've committed and merged a fix that will > report such items as "". You can now list most of the writer > options (just a few colors show as ). > > I'm not sure whether the use of light userdata is intentional here > (this isn't a 3.0 thing; it was already the case in previous > versions). Albert? Let's call it semi-intentional: what happens is that we go via JSON to create the Lua representation of the writer options. The problem is that, if a JSON value is `null`, we can't use `nil` in Lua because that would make the key "disappear", i.e., it would not show up when iterating through the resulting table with `pairs`. So, in an effort to gain compatibility with the very popular Lua library "cjson", we represent `null` values as C null pointers. Hence the "light userdata". The one solution I can think of is to set a custon `__pairs` metamethod on PANDOC_WRITER_OPTIONS. That would allow us to set the missing values to `nil`, while still having `pairs(PANDOC_WRITER_OPTIONS)` list all supported keys. Please feel free to raise an issue for this on GitHub. -- Albert Krewinkel GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124