public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Problem running Lua filters after Pandoc update
@ 2022-01-27 16:28 Gisbert W. Selke
       [not found] ` <a9a414f3-9400-4a35-bb51-588b2bdcf460n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Gisbert W. Selke @ 2022-01-27 16:28 UTC (permalink / raw)
  To: pandoc-discuss


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

After updating from Pandoc 2.12.x to 2.17.0.1 some (all?) of my Lua filters 
stopped working. E.g., pandoc-quotes.lua 
(https://github.com/odkr/pandoc-quotes.lua) balked  
with "attempt to call nil value" in this function:

function insert_quot_marks (quoted) 
   if not QUOT_MARKS then return end 
   local quote_type = quoted.c[1] 
   local inlines = quoted.c[2] 
   local left, right 
   if quote_type == 'DoubleQuote' then left, right = 1, 2 
   elseif quote_type == 'SingleQuote' then left, right = 3, 4 
   else error('unknown quote type') end 
   insert(inlines, 1, QUOT_MARKS[left]) 
   insert(inlines, QUOT_MARKS[right]) 
   return inlines 
end 

After changing lines 3 and 4 to
  local quote_type = quoted.quotetype
  local inlines    = quoted.content
it ran OK again, so I'm happy here (again). To note: the filter skript had 
not been changed in any way for years, so I wonder what happened.
I have several more (and somewhat longer) filters that I would also need to 
update. Before I embark on this: was this initial error just me doing 
something stupid, or is there some description somewhere on what exactly 
has changed and how, or advice on how to access these fields properly? (I'm 
just dabbling in Lua, it's not my native tongue.)
  
(I have tried to wade through the Pandoc changelog, but apart from general 
references about changing to and from hslua I did not find anything 
specific.)

-- 
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/a9a414f3-9400-4a35-bb51-588b2bdcf460n%40googlegroups.com.

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Problem running Lua filters after Pandoc update
       [not found] ` <a9a414f3-9400-4a35-bb51-588b2bdcf460n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2022-01-27 17:19   ` Albert Krewinkel
       [not found]     ` <87tudpm62b.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Albert Krewinkel @ 2022-01-27 17:19 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw; +Cc: Gisbert W. Selke

Hi Gisbert,

"Gisbert W. Selke" <gisbert.selke-f2bn9DS6+XnCNGIDtd5pJw@public.gmane.org> writes:

> After updating from Pandoc 2.12.x to 2.17.0.1 some (all?) of my Lua
> filters stopped working.

I think there's a mixture of reasons here. We have made quite
substantial changes to the Lua subsystem over the last few
releases, but *most* of these were backwards compatible when
looking just at the official API. E.g., while `.c` no longer works
the way it used to, accessing that field was never really
supported in the first place. The majority of filters that use
just the documented API should continue to work.

One change that's not backwards compatible concerns metadata
tagging: metadata values no longer have a `.t` field. I
believe most filter authors have updated their filters by now, so
it may be enough to download newer versions of the broken filters.
If that doesn't fix it, tell the author about it.

Is this the kind of information you were looking for and does it
answer your question?

Cheers,
Albert

-- 
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe  e836 388d c0b2 1f63 1124


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Problem running Lua filters after Pandoc update
       [not found]     ` <87tudpm62b.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
@ 2022-01-27 17:49       ` Gisbert W. Selke
  0 siblings, 0 replies; 3+ messages in thread
From: Gisbert W. Selke @ 2022-01-27 17:49 UTC (permalink / raw)
  To: pandoc-discuss


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

That is perfectly what I needed to know, Albert (not to mention that it was 
ultra-fast)! In the case of pandoc-quotes, I'll point the author to this 
(and supply the fix). In the case of my own scripts, this will teach the 
author not to use undocumented interfaces ;-)

Thnxalot -- viele Grüße --

\Gisbert
Albert Krewinkel schrieb am Donnerstag, 27. Januar 2022 um 18:39:33 UTC+1:

> Hi Gisbert,
>
> "Gisbert W. Selke" <gisber...-f2bn9DS6+XnCNGIDtd5pJw@public.gmane.org> writes:
>
> > After updating from Pandoc 2.12.x to 2.17.0.1 some (all?) of my Lua
> > filters stopped working.
>
> I think there's a mixture of reasons here. We have made quite
> substantial changes to the Lua subsystem over the last few
> releases, but *most* of these were backwards compatible when
> looking just at the official API. E.g., while `.c` no longer works
> the way it used to, accessing that field was never really
> supported in the first place. The majority of filters that use
> just the documented API should continue to work.
>
> One change that's not backwards compatible concerns metadata
> tagging: metadata values no longer have a `.t` field. I
> believe most filter authors have updated their filters by now, so
> it may be enough to download newer versions of the broken filters.
> If that doesn't fix it, tell the author about it.
>
> Is this the kind of information you were looking for and does it
> answer your question?
>
> Cheers,
> Albert
>
> -- 
> 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/6fce8984-db47-468d-9679-591f31815c99n%40googlegroups.com.

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-27 17:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-27 16:28 Problem running Lua filters after Pandoc update Gisbert W. Selke
     [not found] ` <a9a414f3-9400-4a35-bb51-588b2bdcf460n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-01-27 17:19   ` Albert Krewinkel
     [not found]     ` <87tudpm62b.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2022-01-27 17:49       ` Gisbert W. Selke

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).