Skip to content

Commit

Permalink
Merge pull request #11467 from tarleb/chore/remove-unused-function-wa…
Browse files Browse the repository at this point in the history
…lk_meta

Remove unused function `_quarto.ast.walk_meta`
  • Loading branch information
cscheid authored Nov 18, 2024
2 parents 9204b9b + 195b957 commit 603c237
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 43 deletions.
38 changes: 0 additions & 38 deletions src/resources/filters/ast/customnodes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -249,42 +249,6 @@ function create_emulated_node(t, tbl, context, forwarder)
return result, custom_node_data[id]
end

-- walk_meta walks a Pandoc Meta object, applying the filter to each node
-- and recursing on lists and objects. It mutates the meta object in place
-- and returns it.
--
-- It performs slightly more work than a regular walk filter because of the
-- ambiguity around single-element lists and objects.
function walk_meta(meta, filter)
local skip = {
["nil"] = true,
number = true,
boolean = true,
string = true,
["function"] = true,
}
local iterate = {
Meta = true,
List = true,
}
local function walk(obj)
local t = type(obj)
if skip[t] then
return obj
end
local pt = quarto.utils.type(obj)
if iterate[pt] then
for k, v in pairs(obj) do
obj[k] = walk(v)
end
else
return _quarto.ast.walk(obj, filter)
end
return obj
end
return walk(meta)
end

_quarto.ast = {
vault = {
_uuid = "3ade8a4a-fb1d-4a6c-8409-ac45482d5fc9",
Expand Down Expand Up @@ -541,8 +505,6 @@ _quarto.ast = {

walk = run_emulated_filter,

walk_meta = walk_meta,

writer_walk = function(doc, filter)
local old_custom_walk = filter.Custom
local function custom_walk(node)
Expand Down
5 changes: 0 additions & 5 deletions src/resources/filters/normalize/extractquartodom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ function parse_md_in_html_rawblocks()
end
return result
end,
-- Meta = function(meta)
-- local filter = parse_md_in_html_rawblocks()
-- local result = _quarto.ast.walk_meta(meta, filter)
-- return result
-- end,
}
end

Expand Down

0 comments on commit 603c237

Please sign in to comment.