From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/26691 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: jiewuza Newsgroups: gmane.text.pandoc Subject: Re: Inconsistent results of returning the original or a new Image in lua filter Date: Sat, 31 Oct 2020 09:44:43 +0800 Message-ID: References: <87o8kjllet.fsf@zeitkraut.de> 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="24428"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (darwin) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Cancel-Lock: sha1:mVfr48Je4dBxrom8zKNWbzoeN/o= Original-X-From: pandoc-discuss+bncBCKYBFEGRAJRBIMD6P6AKGQEZ75SOYY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Oct 31 02:45:10 2020 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-lj1-f184.google.com ([209.85.208.184]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kYfx7-0006Ft-5U for gtp-pandoc-discuss@m.gmane-mx.org; Sat, 31 Oct 2020 02:45:09 +0100 Original-Received: by mail-lj1-f184.google.com with SMTP id r17sf3385089lji.7 for ; Fri, 30 Oct 2020 18:45:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1604108708; cv=pass; d=google.com; s=arc-20160816; b=hjVIgyxtE3O6c77W1DtMxNVeb6UTTaD0OOEcjisXhAe1e/v2uEw6qT+GoKJcUM/1/l ox0br29E//nw1SweWGTSbOECiWhf666VlJl5hixrmHLB+0Fuq/Z+b9iVI7Fqpk1NHJUj 2GLsKNPz2dSgZtIg0Ey4tRfR5ALtGMFgMnxMeejbbw1iLw3Nyd7BksHt84bp/qaddiCR bhONryxOc6ZwCOqIDSjZK+0woje87DqOBxA+h7VMAWgAd9tZes9pQAfB0AFjEUeKESET fcUHfNeAPiIR902x3Pq20EwkbbgNIhFbNwo9md9Xq7OqNl77BF/xBwbBBL2twMZ2DHtd TUFw== 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:cancel-lock:user-agent :mime-version:references:message-id:date:subject:from:to:sender :dkim-signature; bh=CUNp4litmC5oA/oh37w4ltRoZrFXpONbSkDoYfaLeoQ=; b=CMBPbkAhcYDylo5fkQ/YbedF4oghU7s1vBPrYDOybcfcIY+N3d6UEDwGPY9atvqzyW tIdPmlz/Gl5ioZoB40Rk16kjYetimqIoZxM5tOn/OWLts2S9WgswUGg+rP9WaUx+r+5Q Dk7tcmOkaQPz1XZHE+M6TgoaoyAgPw26ujwmzvKbxKeAsR93NdVGgFPuZdq3QSzeploV PnCVaRiHSguMyaPiGYEeled6XZU99wDNq9CXaL9o9iWQXPKffPWGB8iCcez+nUCvu9g3 zIadCnhXMvTfT3LYAjHsmqu7PnshkBlqC5kv/NIQwu+XT7WdbA9MSPJeU1iJvoZOBb7n M3tg== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of gtp-pandoc-discuss@m.gmane-mx.org designates 116.202.254.214 as permitted sender) smtp.mailfrom=gtp-pandoc-discuss@m.gmane-mx.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=163.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:to:from:subject:date:message-id:references:mime-version :user-agent:cancel-lock: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=CUNp4litmC5oA/oh37w4ltRoZrFXpONbSkDoYfaLeoQ=; b=DObPv/EVq0ibLzWWyBeSCudwxNfUytFGw2o2sM6tZ2i9cppgiHFBVNihcF71P9D0kS 9AvE9jivmB1vD3VHLMpSuEvoEDw4CFkBV5iNPl7cQxf6qK53SkNqPqPljHQi2BnbQcDA 7FLjoynRtEDTvFyiaCBJFglPrQ8e/NUgLCDBX0ppCatqWHV/x8ahNZBLIUXgymg+raJa 1wieLbjD/LHowzdVrFwASBuwAdJGIos/d5nUX6CFY8aPWP3nFQv6Lt3NMNd7WY2H3AuL U62Rxaj8NAzWWfPHmb7of0l8Av++nXbC+NFNrtgkWAi/+jjtH1pEh3nVoWaPjq3Dw3kc 1FPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:to:from:subject:date:message-id :references:mime-version:user-agent:cancel-lock: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=CUNp4litmC5oA/oh37w4ltRoZrFXpONbSkDoYfaLeoQ=; b=gBc/Fy777rdLBABXQU0FNhv7CqV254zmVL8+i+SUM4ykA0o7fgrJyaNvTWlbhWIjbt XiP2MBOHb3fKcEUKTAnL9X7GCj/PxqKI0j1Y8UjjOHaHzskhYzJ61wPzaqxpTIeQDwdl U1VDv0mhISNlDFDeDulqXzZAAtdumqq+ESC9r+kjw0DWoLt8RT5xiWXDHJ3fenjH9M5g CUvQ1xdD3uVU9NgA98/fO8z5ExaBJro5lNCoh0J0SNci2GkL/b42dgAydpCjEsybrf8Y 53zyIwKGLR2o1O8N+taJc4izL/y20kj+p+0qQ8KG0F4Fig5uW492jNw/bcF3zUDZ/+3y ylsA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM532L6fXXcJPZOytg+g13QJ6+pDWkd7cm9VgRocbGxKVIONJRwARR EsudsxEUNfjZJbIGd8GVNTg= X-Google-Smtp-Source: ABdhPJxzsYo0BpJpDtbe/JVK4kONfsiJbTCIeSChLiobMqvTMxN8Y9yHomzxuGmmpKugt4qM5jcIxg== X-Received: by 2002:a2e:8108:: with SMTP id d8mr2275467ljg.96.1604108708794; Fri, 30 Oct 2020 18:45:08 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:ac2:546b:: with SMTP id e11ls1979061lfn.0.gmail; Fri, 30 Oct 2020 18:45:04 -0700 (PDT) X-Received: by 2002:a19:87d5:: with SMTP id j204mr2166185lfd.212.1604108704718; Fri, 30 Oct 2020 18:45:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604108704; cv=none; d=google.com; s=arc-20160816; b=qWWAZXI8D2mmouezX5EObfJSjk+D7GNQtgiztjWhFLaZCuc369HAVOnR8n9R87yI4O 9iRgfOrcDXJPVxeNIkn+yIMqpNREh0NXQQ6XG7VYNh2LQkkhS1jv1wOnkmrPL/TCV1vD jJhnUw5gzHo3K65/nHhbCQldbY5FzCMB1STbJpWFxkrmqbCM+U93RZYbw6E6001vh0GQ lkI0+4xS/T45SlLLB97o8RjNcyDwJgmZaM4U5ZJ01+KpL7YgGszbrcGELpMaO1SnWVCV oHpY51+PYeeIIF1UuNZVrzBIT0TTdvpdz0QSitMz5juxRmwHQ9m0HSOV2Ym8n6hc3/Nx Yzow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cancel-lock:user-agent:mime-version:references:message-id:date :subject:from:to; bh=ji3NQBDfxPr4OlFbxsxJxOidPR0RMnC3b7UN82nD20Q=; b=b8O2Q+ziu6wK212is0ABzLfbzmXX0ed7HvhnYzJ0sl+mykNR+KYCM7Sd5U4niTNHAJ rjnrjIWXYQ92wcxErz9teXyKvo8IIx4BCvFe3siI1OD8I1TDOhsWqrf+SiLxQzqJSQ+C MXZPQZ1mqUA23lRMyLEYZe7OQPm6snAocnokD21DPdVnZ2zb+Fqf4BmCiZiBuhP4qcdm WVpmrq+8aPsu7eXCjUoC+ugRa88BBJFhASgHB5R0LiJrVuuYt7io8pmzuBd7Zz5R28a/ 9+rH/d2Gu2LkgDY6Y7YbngknXoqwSVthEA1ODpXbFe5vhVdVuiJuWtu1yyalGJD2HdG5 Gi1A== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of gtp-pandoc-discuss@m.gmane-mx.org designates 116.202.254.214 as permitted sender) smtp.mailfrom=gtp-pandoc-discuss@m.gmane-mx.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=163.com Original-Received: from ciao.gmane.io (static.214.254.202.116.clients.your-server.de. [116.202.254.214]) by gmr-mx.google.com with ESMTPS id x19si288195ljh.2.2020.10.30.18.45.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2020 18:45:04 -0700 (PDT) Received-SPF: pass (google.com: domain of gtp-pandoc-discuss@m.gmane-mx.org designates 116.202.254.214 as permitted sender) client-ip=116.202.254.214; Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1kYfx0-00067a-F7 for pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; Sat, 31 Oct 2020 02:45:02 +0100 X-Injected-Via-Gmane: http://gmane.org/ X-Original-Sender: gtp-pandoc-discuss@m.gmane-mx.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of gtp-pandoc-discuss@m.gmane-mx.org designates 116.202.254.214 as permitted sender) smtp.mailfrom=gtp-pandoc-discuss@m.gmane-mx.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=163.com 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:26691 Archived-At: Albert Krewinkel writes: > > Pandoc's writers treat images as figures iff > > 1. the image is the only element in a paragraph, and > 2. the image's title begins with the string 'fig:'. > > The modified function removes the title from the image element, so > condition 2 is no longer satisfied. The title can be passed as the third > argument to the `pandoc.Image` function, which will mark it as a figure > again: > > function Image(img) > return pandoc.Image(img.caption, img.src, img.title) > end > I also tried ``` function Image(img) print(obj.t, TableToStr(obj)) return pandoc.Para{pandoc.Image(img.caption, img.src)} end ``` But the image goes away from the output. Is it because Image is inline and Para is block? But no error is reported.