public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Philipp <philipp.kupferschmied-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: Lua filter broken after upgrade to 2.15 (macOS)
Date: Mon, 1 Nov 2021 08:26:10 -0700 (PDT)	[thread overview]
Message-ID: <0e68ba01-4ebe-47c1-a7fd-3049b41b2785n@googlegroups.com> (raw)
In-Reply-To: <87fssg6rsp.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 2157 bytes --]

Thanks a lot for your help, my filter is working again :-)
As both `return pandoc.Str('")` and `return {}`solve the problem, I wonder 
if one of the two solutions is preferable over the other.


Albert Krewinkel schrieb am Montag, 1. November 2021 um 12:26:08 UTC+1:

> Sorry, I forgot to answer the original question: You can fix the filter
> by changing `return pandoc.Str()` to `return {}`.
>
> HTH
>
>
> Philipp <philipp.ku...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
> > 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
>
>
> --
> Albert Krewinkel
> GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124
>

-- 
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/0e68ba01-4ebe-47c1-a7fd-3049b41b2785n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 3118 bytes --]

  parent reply	other threads:[~2021-11-01 15:26 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
     [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 [this message]
     [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=0e68ba01-4ebe-47c1-a7fd-3049b41b2785n@googlegroups.com \
    --to=philipp.kupferschmied-re5jqeeqqe8avxtiumwx3w@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).