Skip to content

When traversing with a Lua filter in top-down mode, exclude Metadata fields from external YAML file #9369

Answered by tarleb
kopeckyf asked this question in Q&A
Discussion options

You must be logged in to vote

Indeed, looking at the code it seems that this is not implemented for Meta elements. Feel free to raise a bug.

My approach would be to place the filter in a table, and then use walk to apply the filter on the document body:

local my_filter = {
  traverse = 'topdown',
  Str = function (s)
    -- ...
  end
}

function Pandoc(doc)
  doc.blocks = doc.blocks:walk(my_filter)
  return doc
end

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@kopeckyf
Comment options

@kopeckyf
Comment options

Answer selected by kopeckyf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants