aboutsummaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2021-12-08 19:06:48 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2021-12-11 08:59:11 -0800
commit83b5b79c0e4f073198b5af11b9e8a0a4471fcd41 (patch)
tree699ea018e8fe1ef4aa47c49abb2c4708caf2c641 /data
parentbfb3118ebb1f24d8b12a806ef0ade14d5c4575ce (diff)
downloadpandoc-83b5b79c0e4f073198b5af11b9e8a0a4471fcd41.tar.gz
Custom reader: pass list of sources instead of concatenated text
The first argument passed to Lua `Reader` functions is no longer a plain string but a richer data structure. The structure can easily be converted to a string by applying `tostring`, but is also a list with elements that contain each the *text* and *name* of each input source as a property of the respective name. A small example is added to the custom reader documentation, showcasing its use in a reader that creates a syntax-highlighted code block for each source code file passed as input. Existing readers must be updated.
Diffstat (limited to 'data')
-rw-r--r--data/creole.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/data/creole.lua b/data/creole.lua
index 5b7d7f554..590dfc871 100644
--- a/data/creole.lua
+++ b/data/creole.lua
@@ -186,5 +186,5 @@ G = P{ "Doc",
}
function Reader(input, reader_options)
- return lpeg.match(G, input)
+ return lpeg.match(G, tostring(input))
end