From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/28627 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bastien DUMONT Newsgroups: gmane.text.pandoc Subject: Re: Fenced Div to ConTeXt Environment (was: Markdown Fenced Div to LaTeX Environment) Date: Thu, 17 Jun 2021 08:18:54 +0000 Message-ID: References: <8ba84992-d792-4333-aae0-560147ef79d4n@googlegroups.com> <87pn1uwglb.fsf@zeitkraut.de> <20210616143731.GA29446@sokrates> <5db56b4f1d8d4ca2bec612bcebb7a525@unibe.ch> <493d0aa9-47f5-ca8d-2ef5-8e63f965c529@mailbox.org> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17767"; mail-complaints-to="usenet@ciao.gmane.io" To: 'juh' via pandoc-discuss Original-X-From: pandoc-discuss+bncBDCINCES2QJRBFULVSDAMGQEHF4ZQZY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Jun 17 10:19:37 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ed1-f63.google.com ([209.85.208.63]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ltnFQ-0004Ni-CP for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 17 Jun 2021 10:19:36 +0200 Original-Received: by mail-ed1-f63.google.com with SMTP id f12-20020a056402150cb029038fdcfb6ea2sf1062657edw.14 for ; Thu, 17 Jun 2021 01:19:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1623917976; cv=pass; d=google.com; s=arc-20160816; b=Kud4kxN0aSorzGfTfcvr4jUoS+82xpKn/n/vkDakBue+DMusM1zXi6EtSM45ZVO0kD 9AU9GxAHVAfUTaqfO8eyEXx+Gqd9g+IqMc0d32qBdLNUAFbzIEv43dxFjjxdSMFvaUhL Fes2am/eAJfM/jBZPku3gAaDeKDzv/VA+m8wOM//28K1W0T7J2INFaOinFCGGHFEw9Hx w9BMsF9dlg0T+gctLHOxFOqOML3vXestOAGvXUAi35jRW6UqOQ3wCylJCrPVVwFmhEn0 qYvsXPeEtroJMIocXEMXuf+G8PWdB9hitAcGtwVelwR8lVMjqIoIcTrPbWy2V5laQOw5 epIQ== 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:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:to:from:date:sender:dkim-signature; bh=bVV8jSi8x922nKuUXn08jshWv6pt+gf0WqCqQFXYlUA=; b=hXKOSzYJmNfOCF3Pc7gTeyvmFonu6zW4qwFlYL/OB9Gl4GeYPrjq4xs3wsFMq5auuu vy0LYysSplBMtRqdxntNmWGCgYi8PQjGYCflfEJiuF3kqOz4HohXzzQD8sbdViM2tyEg sZWOSszuJlILTENhKTdTJNF8jIg0PF8GLQwfcfsXxoHRd1+wCVS+bK53rkPXu6gW6j54 Ihg6PfStEdDcBl4LEXMcbP6XfyRFVe0YyDa1pditGsBlAywqtAMo/SWwVjLFjhvwyLt+ ATIoXIYU2b3VPeNRTe7MgrkC+IOyKlSbtKI/jF0yU9zwR1q8pXQP+jF1dhdHi+sGPJpv 4znQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=asG8IFCJ; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 as permitted sender) smtp.mailfrom=bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=bVV8jSi8x922nKuUXn08jshWv6pt+gf0WqCqQFXYlUA=; b=LRskAHmIrA78xAX7+hNlIE77s7CnVQhlnhXuY8WqGtagfHV5O072oTn+ihCdFmGDfb Ip7tVbkRrT2sJlHs3Qwk3B4DKGNurRiVBXXZIxqSaC62UdPEWuA3XSaGEbjcv/x6VJ3X 6O5EVlsBfnUQvZ46i3GG2Ucbs1NQ+fcTJ7SZhthGi/3WPUejW7sfQHPco4cpUwSmYPJ3 +5oUTCcmwSVeX02DX/zT9W3Yw9XRD9uhuvsPKsX+Aa14kzPAvtxIWL2+hMlCUKuHyaqm doWfuk/1XyB1EFiFfs9P9qe7VGUIuYV3GQ3hJmHFmixcK6Yx3TjhUjd1ba8h6Cyxkfjz 9UiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:date:from:to:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=bVV8jSi8x922nKuUXn08jshWv6pt+gf0WqCqQFXYlUA=; b=tHdhiJPUfz0kyg9z48MXWrjWs19SwQp7BWCHr29/JeDyMD8mnVPqca3reGeim834+s u+GaDdxxosMwZhdDjoXKmEhQkWO9LsaXiPtEGvCAPOKD1bONmYolCoy/ZLs4EGPXqwNs kpOBLgl6W35kde1akyy79ruIG3FGDXJGGnxvvi23r2wvGr1n1m5Won+3D1vl/wi/CqCn ajxtmoP6ZeimDVjzDQq9gxoe1iGnftvHdX7AvZEFAaobE5qKwjLnao9BxITICgkRSpKe 4Luu+fmrB1chO/qN0t5Gd4MbB1izavh1rHrFqNVnVIxE Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM531A8FuU7n6lHRvqf2ppvTIUMaQ9oFINyCdS2V8F0vcrFcFfM97r oed69O6kPpuQxZShrG+tY5A= X-Google-Smtp-Source: ABdhPJwEj9UAOFvfCTq80zGB9SJ8cqQoCzT86BYaKDHtKBOIjhKBv8vmjGKMLDbiQjyUCz7ObkxO/g== X-Received: by 2002:aa7:d5c6:: with SMTP id d6mr4852026eds.290.1623917976081; Thu, 17 Jun 2021 01:19:36 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a17:906:af99:: with SMTP id mj25ls2233295ejb.4.gmail; Thu, 17 Jun 2021 01:19:33 -0700 (PDT) X-Received: by 2002:a17:906:35cd:: with SMTP id p13mr4046218ejb.24.1623917973410; Thu, 17 Jun 2021 01:19:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623917973; cv=none; d=google.com; s=arc-20160816; b=qRlHxVWEKC6Q768uTLQYzxjIdmc7QDg1t0s68NzHvS2qs9q5ZFFA9wL+5NaR3sA20X 7cf7MZ5wVfY7hmrD1D0YIkF/QRhWf6WUUO9TDLhQ1/Ok00WTYEcNv+JoWVdPEHN8O+mn 96v/OqAFPwfPjOX8lDvstkE1amPtgk2dBAlAShth6sFmLDT0qLVav8MxX8LT8oZxI86k 6sDdwRpCjm0YdsncMWwvMPVD74Zyiz3E3sw3BAYrXe0iEos6ja/pCuPm3Iq9vTil8gKA n4kCzbFloaf0Ai9CGQgH33gFaU9Y54na8+9N8p4gHFrKozX4k1yN9hgbWIp/n5DeriKD KS/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:to:from:date :dkim-signature; bh=BRMZwk6IFyYLjLqwNKvdwEsurR5N6aRHgJxiUC3Y30w=; b=iTJCg/0VtvH5ljIXeWaos3jHWWIkYTXV8xoJCKwqdZW8ols3dbLGQLahHHr6/9aSH/ cl8JraMlQ80+NlfcXqWM7cBQ6+SAvB9Lg+alXkdleOX8WzFyKy2OTFJR+oIoYEz0Gxdb H3oCNQzaounpJr1z6jnSJt9l5+srUiOLUCs+340dXXTDquXQIVBrs8PuKP15CTdlq8SZ 61laj5wjDySOaGAY+XPLjMJDt0VStU+pBzGVavuAP+4OxaeT1kKosNTdUQ14sZ2lO4cb 4aIZY9pwyMgzh3eHn3SiWBEXM2HKWlqTPiz+Z04I/t2Y25umVC7w0qk8T8o7eNG4xhWm xcJg== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=asG8IFCJ; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 as permitted sender) smtp.mailfrom=bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Original-Received: from mout01.posteo.de (mout01.posteo.de. [185.67.36.65]) by gmr-mx.google.com with ESMTPS id s9si239114edw.4.2021.06.17.01.19.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jun 2021 01:19:33 -0700 (PDT) Received-SPF: pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 as permitted sender) client-ip=185.67.36.65; Original-Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id E8576240026 for ; Thu, 17 Jun 2021 10:19:32 +0200 (CEST) Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4G5FMm4KQXz9rxB for ; Thu, 17 Jun 2021 10:19:32 +0200 (CEST) Content-Disposition: inline In-Reply-To: X-Original-Sender: bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=asG8IFCJ; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 as permitted sender) smtp.mailfrom=bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net 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:28627 Archived-At: The problem is that el.content is a List, and the Div function must return = a Block or a list of Blocks. The error means that Pandoc doesn't recognize = the List provided by el.content as a Block, which is normal. I see two solutions: =E2=80=93 The simplest one: replace el.content by el (so that it returns = two RawBlocks and a Div, which is a kind of Block); =E2=80=93 If you really want the content of the Div to be extracted from = the Div and the Div to be removed from the output: function context(s) return pandoc.RawBlock('context', s) end function Div(el) if el.classes[1] =3D=3D 'intro' then local intro =3D {} table.insert(intro, context('\\startparagraph{intro}')) for i =3D 1, #el.content do table.insert(intro, el.content[i]) end table.insert(intro, context('\\stopparagraph')) return intro end end I guess that the first solution should satisfy your needs, but the second o= ne is worth mentionning for other applications. Le Thursday 17 June 2021 =C3=A0 09:55:40AM, 'juh' via pandoc-discuss a =C3= =A9crit : >=20 > Am 17.06.21 um 08:54 schrieb BPJ: > > --filter/-F is for JSON filters. Lua filters need --lua-filter/-L >=20 > Thanks a lot! Now the error message is much more informative. >=20 > This is my filter: >=20 > function context(s) > return pandoc.RawBlock('context', s) > end >=20 > function Div(el) > if el.classes[1] =3D=3D 'intro' then > return { context('\\startparagraph{intro}'), el.content, > context('\\stopparagraph') } > end > end >=20 >=20 > This is the error message >=20 > Error running filter filter.lua: > Could not read list: Could not get Block value: untagged value >=20 > Any hints? > juh >=20 > --=20 > 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/msgi= d/pandoc-discuss/dc8ef20b-4a8b-c385-704c-28c85a5b6820%40mailbox.org. --=20 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 e= mail 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/YMsFbs5tYl1pZsZq%40localhost.