Skip to content

Commit

Permalink
Use stringify to some extent
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoWinterhalter committed Oct 28, 2024
1 parent 5b5dbbb commit fede1a7
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions pandoc/paper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,18 @@ function yamldata(data)

local newdata = {}

-- A bit ridiculous to do this to get strings
newdata.title = pandoc.write(pandoc.Pandoc{data["title"]}, 'html')
newdata.title = pandoc.utils.stringify(data["title"])
newdata.url = pandoc.write(pandoc.Pandoc{data["url"]}, 'html')
newdata.authors = data["authors"] or {}
newdata.venue = pandoc.write(pandoc.Pandoc{data["venue"]}, 'html')
newdata.year = pandoc.write(pandoc.Pandoc{data["year"]}, 'html')
newdata.venue = pandoc.utils.stringify(data["venue"])
newdata.year = pandoc.utils.stringify(data["year"])
local files = data["files"] or pandoc.List()

newdata.files = files:map(function(data)
local newfile = {}

newfile.text = pandoc.write(pandoc.Pandoc{data.text}, 'html')
newfile.type = pandoc.write(pandoc.Pandoc{data.type}, 'html')
newfile.text = pandoc.utils.stringify(data.text)
newfile.type = pandoc.utils.stringify(data.type)
newfile.src = pandoc.write(pandoc.Pandoc{data.src}, 'html')

return newfile
Expand Down

0 comments on commit fede1a7

Please sign in to comment.