Skip to content

Commit 7879268

Browse files
committed
Use jog for traversals in the flags filters
1 parent 5b01b2a commit 7879268

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

src/resources/filters/main.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,8 @@ tappend(quarto_normalize_filters, quarto_ast_pipeline())
260260
local quarto_pre_filters = {
261261
-- quarto-pre
262262
{ name = "flags",
263-
filter = compute_flags()
263+
filters = compute_flags(),
264+
traverse = 'jog',
264265
},
265266

266267
{ name = "pre-server-shiny",

src/resources/filters/normalize/flags.lua

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,7 @@ function compute_flags()
2424
return false
2525
end
2626

27-
return {
28-
Meta = function(el)
29-
local lightbox_auto = lightbox_module.automatic(el)
30-
if lightbox_auto then
31-
flags.has_lightbox = true
32-
elseif lightbox_auto == false then
33-
flags.has_lightbox = false
34-
end
35-
end,
27+
return {{
3628
Header = function(el)
3729
if find_shortcode_in_attributes(el) then
3830
flags.has_shortcodes = true
@@ -76,7 +68,6 @@ function compute_flags()
7668
if el.text:find("%{%{%<") then
7769
flags.has_shortcodes = true
7870
end
79-
8071
end,
8172
Div = function(node)
8273
if find_shortcode_in_attributes(node) then
@@ -187,5 +178,14 @@ function compute_flags()
187178
Figure = function(node)
188179
flags.has_pandoc3_figure = true
189180
end
190-
}
191-
end
181+
}, {
182+
Meta = function(el)
183+
local lightbox_auto = lightbox_module.automatic(el)
184+
if lightbox_auto then
185+
flags.has_lightbox = true
186+
elseif lightbox_auto == false then
187+
flags.has_lightbox = false
188+
end
189+
end,
190+
}}
191+
end

0 commit comments

Comments
 (0)