Skip to content

Commit 217a15f

Browse files
committed
Use jog instead of walk
1 parent 641c36e commit 217a15f

File tree

11 files changed

+18
-17
lines changed

11 files changed

+18
-17
lines changed

src/resources/filters/ast/customnodes.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function run_emulated_filter(doc, filter)
7373
-- luacov: enable
7474
end
7575
end
76-
return node:walk(filter_param)
76+
return _quarto.modules.jog(node, filter_param)
7777
end
7878

7979
-- performance: if filter is empty, do nothing

src/resources/filters/common/layout.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ end
5656
-- we often wrap a table in a div, unwrap it
5757
function tableFromLayoutCell(cell)
5858
local tbl
59-
cell:walk({
59+
_quarto.modules.jog(cell, {
6060
Table = function(t)
6161
tbl = t
6262
end

src/resources/filters/common/pandoc.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,14 +217,14 @@ function string_to_quarto_ast_blocks(text, opts)
217217

218218
-- run the whole normalization pipeline here to get extended AST nodes, etc.
219219
for _, filter in ipairs(quarto_ast_pipeline()) do
220-
doc = doc:walk(filter.filter)
220+
doc = _quarto.modules.jog(doc, filter.filter)
221221
end
222222

223223
-- compute flags so we don't skip filters that depend on them
224-
doc:walk(compute_flags())
224+
_quarto.modules.jog(doc, compute_flags())
225225
return doc.blocks
226226
end
227227

228228
function string_to_quarto_ast_inlines(text, sep)
229229
return pandoc.utils.blocks_to_inlines(string_to_quarto_ast_blocks(text), sep)
230-
end
230+
end

src/resources/filters/common/wrapped-filter.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ function makeWrappedJsonFilter(scriptFile, filterHandler)
9797
path = quarto.utils.resolve_path_relative_to_document(scriptFile)
9898
local custom_node_map = {}
9999
local has_custom_nodes = false
100-
doc = doc:walk({
100+
doc = _quarto.modules.jog(doc, {
101101
-- FIXME: This is broken with new AST. Needs to go through Custom node instead.
102102
RawInline = function(raw)
103103
local custom_node, t, kind = _quarto.ast.resolve_custom_data(raw)
@@ -130,7 +130,7 @@ function makeWrappedJsonFilter(scriptFile, filterHandler)
130130
return nil
131131
end
132132
if has_custom_nodes then
133-
doc:walk({
133+
_quarto.modules.jog(doc, {
134134
Meta = function(meta)
135135
_quarto.ast.reset_custom_tbl(meta["quarto-custom-nodes"])
136136
end

src/resources/filters/quarto-post/book.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ local license = require 'modules/license'
88
local function clean (inlines)
99
-- this is in post, so it's after render, so we don't need to worry about
1010
-- custom ast nodes
11-
return inlines:walk {
12-
Note = function (_) return {} end,
11+
return _quarto.modules.jog(inlines, {
12+
traverse = 'topdown',
13+
Note = function (_) return {}, false end,
1314
Link = function (link) return link.content end,
14-
}
15+
})
1516
end
1617

1718
--- Creates an Inlines singleton containing the raw LaTeX.

src/resources/filters/quarto-post/delink.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function delink()
1919
-- find links and transform them to spans
2020
-- this is in post, so it's after render, so we don't need to worry about
2121
-- custom ast nodes
22-
return pandoc.walk_block(div, {
22+
return _quarto.modules.jog(div, {
2323
Link = function(link)
2424
return pandoc.Span(link.content)
2525
end

src/resources/filters/quarto-post/latex.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ function render_latex()
407407
end,
408408
Note = function(el)
409409
tappend(noteContents, {el.content})
410-
el.content:walk({
410+
_quarto.modules.jog(el.content, {
411411
CodeBlock = function(el)
412412
hasVerbatimInNotes = true
413413
end

src/resources/filters/quarto-post/render-asciidoc.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function render_asciidoc()
8989
local noteEl = el[i+1]
9090
-- if the note contains a code inline, we need to add a space
9191
local hasCode = false
92-
pandoc.walk_inline(noteEl, {
92+
_quarto.module.jog(noteEl, {
9393
Code = function(_el)
9494
hasCode = true
9595
end

src/resources/filters/quarto-pre/output-location.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ function output_location()
7171
if _quarto.format.isRevealJsOutput() then
7272
return {
7373
Blocks = function(blocks)
74-
local newBlocks = pandoc.List()
74+
local newBlocks = pandoc.Blocks{}
7575
for _,block in pairs(blocks) do
7676
local outputLoc = collectCellOutputLocation(block)
7777
if outputLoc then

src/resources/filters/quarto-pre/shiny.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function server_shiny()
6767
-- blocks.)
6868
local context = nil
6969

70-
local res = pandoc.walk_block(divEl, {
70+
local res = _quarto.modules.jog(divEl, {
7171
CodeBlock = function(el)
7272
if el.attr.classes:includes("python") and el.attr.classes:includes("cell-code") then
7373

0 commit comments

Comments
 (0)