mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-24 15:44:59 +08:00
Lua filter: use destructured functions for inline filters
Instead of taking the whole inline element, forcing users to destructure it themselves, the components of the elements are passed to the filtering functions.
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
return {
|
||||
{ Str = function (inline)
|
||||
if inline.c == "{{helloworld}}" then
|
||||
{
|
||||
Str = function (str)
|
||||
if str == "{{helloworld}}" then
|
||||
return pandoc.Emph {pandoc.Str "Hello, World"}
|
||||
else
|
||||
return inline
|
||||
return pandoc.Str(str)
|
||||
end
|
||||
end,
|
||||
end,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user