public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
To: Albert Krewinkel
	<albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>,
	pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: Lua filter broken after upgrade to 2.15 (macOS)
Date: Sun, 31 Oct 2021 10:42:40 -0700	[thread overview]
Message-ID: <m2h7cxks4v.fsf@Johns-Air.hsd1.ca.comcast.net> (raw)
In-Reply-To: <DDB22D9A-22FC-48BB-B1D0-18B059FD92D7-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>


I can confirm that using pandoc.Str('') instead of pandoc.Str()
works.


Albert Krewinkel <albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org> writes:

> Can't test right now, but can you try to pass an empty string to pandoc.Str('')?
>
> Am 31. Oktober 2021 14:18:16 MEZ schrieb Philipp <philipp.kupferschmied-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:
>>Hello everyone,
>>
>>I'm experiencing a problem with a self-written Lua-filter after upgrading 
>>to 2.15.
>>
>>The filter ran (and still runs) fine with older versions of pandoc, but 
>>with 2.15 I get the following error:
>>
>>PandocLuaError "Error during function call:\n\tstring expected, got 
>>string\n\twhile retrieving function argument string\n\twhile retrieving 
>>arguments for function Str\nstack traceback:\n\t[C]: in field 
>>'Str'\n\tscripts/klausur.lua:11: in function 
>><scripts/klausur.lua:9>\n\t[C]: in ?\n\t[C]: in field 
>>'walk_block'\n\tscripts/klausur.lua:8: in function 'processheader'"
>>
>>stack traceback:
>>
>>[C]: in field 'walk_block'
>>
>>scripts/klausur.lua:8: in function 'processheader'
>>The corresponding Lua code looks like this (I hope the formatting is 
>>preserved):
>>
>> 7 function processheader(elem)
>> 8     return pandoc.walk_block(elem, {
>> 9         Str = function(elem)
>>10             if string.match(elem.text, "%%%d+p%%") ~= nil then
>>11                 return pandoc.Str()
>>12             end
>>13         end
>>14     })
>>15 end
>>
>>I'd be thankful for any suggestion what is going wrong here.
>>
>>Kind regards,
>>Philipp
>>
>>
>>-- 
>>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/7c1cf170-c5cb-4203-a4ba-36407f0ebfecn%40googlegroups.com.
>
> -- 
> 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/DDB22D9A-22FC-48BB-B1D0-18B059FD92D7%40zeitkraut.de.


  parent reply	other threads:[~2021-10-31 17:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-31 13:18 Philipp
     [not found] ` <7c1cf170-c5cb-4203-a4ba-36407f0ebfecn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-10-31 15:11   ` Albert Krewinkel
     [not found]     ` <DDB22D9A-22FC-48BB-B1D0-18B059FD92D7-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2021-10-31 17:42       ` John MacFarlane [this message]
     [not found]         ` <m2h7cxks4v.fsf-d8241O7hbXoP5tpWdHSM3tPlBySK3R6THiGdP5j34PU@public.gmane.org>
2021-10-31 17:43           ` John MacFarlane
     [not found]             ` <m2ee81ks3h.fsf-d8241O7hbXoP5tpWdHSM3tPlBySK3R6THiGdP5j34PU@public.gmane.org>
2021-10-31 18:22               ` Albert Krewinkel
     [not found]                 ` <7BA44317-17A2-450D-90FD-97F61FCC6129-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2021-10-31 19:04                   ` Albert Krewinkel
     [not found]                     ` <020C1DFA-141A-4AF6-83FD-87D400A65090-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2021-10-31 20:12                       ` John MacFarlane
2021-11-01 11:25   ` Albert Krewinkel
     [not found]     ` <87fssg6rsp.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2021-11-01 15:26       ` Philipp
     [not found]         ` <0e68ba01-4ebe-47c1-a7fd-3049b41b2785n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-11-02  7:41           ` Albert Krewinkel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2h7cxks4v.fsf@Johns-Air.hsd1.ca.comcast.net \
    --to=jgm-tvlzxgkolnx2fbvcvol8/a@public.gmane.org \
    --cc=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).