I'd like to convert a CodeBlock into a LineBlock in a Pandoc Lua filter. The problem with that conversion is that the CodeBlock element has a text property (a string), but the LineBlock expects inline content elements (each word, space, newline etc. its own element). How can I convert the text property into content suitable for LineBlock?
This is how my code looks ATM:
function CodeBlock(el)
-- test for manually generating content
-- return pandoc.LineBlock {{pandoc.Str("Some")}, {pandoc.Space()}, {pandoc.Str("content")}}
-- using read does not work, how can I convert the string el.text?
local contentElements = pandoc.read(el.text)
return pandoc.LineBlock(contentElements)
end