memory-leaks

Still reachable: lots of words in many pages.
git clone https://git.kevinlegouguec.net/memory-leaks
Log | Files | Refs | README | LICENSE

print-title.lua (416B)


      1 title = ''
      2 
      3 titlefilter = {
      4   Str = function (element)
      5     title = title .. element.text
      6   end,
      7 
      8   Code = function (element)
      9     title = title .. element.text
     10   end,
     11 
     12   Space = function (element)
     13     title = title .. ' '
     14   end,
     15 }
     16 
     17 function Pandoc(doc)
     18   pandoc.List.map(
     19     doc.meta.title,
     20     function (inline)
     21       pandoc.walk_inline(pandoc.Span(inline), titlefilter)
     22     end
     23   )
     24   print(title)
     25   os.exit(0)
     26 end