@@ -148,91 +148,6 @@ function render_pandoc3_figure()
148148 _quarto .ast .scoped_walk (doc .blocks , filter )
149149 end
150150 }
151-
152- -- split local declaration because Lua's local is not
153- -- a letrec
154- -- local filter
155- -- filter = function(state)
156- -- state = state or {}
157- -- local function figure_renderer(figure, is_subfig)
158- -- -- this is a figure that is not cross-referenceable
159- -- -- if this ends up in a layout without fig-pos = H, it'll fail
160- -- -- 'H' forces it to not float
161- -- if figure.identifier == "" then
162- -- figure = _quarto.ast.walk(figure, {
163- -- Image = function(image)
164- -- image.attributes['fig-pos'] = 'H'
165- -- return image
166- -- end
167- -- })
168- -- end
169- -- local image
170- -- _quarto.ast.walk(figure, {
171- -- Image = function(img)
172- -- image = img
173- -- end
174- -- })
175- -- if image == nil then
176- -- return figure
177- -- end
178- -- if figure.caption.long ~= nil then
179- -- image.caption = quarto.utils.as_inlines(figure.caption.long)
180- -- end
181- -- for k, v in pairs(figure.attributes) do
182- -- image.attributes[k] = v
183- -- end
184- -- if is_subfig then
185- -- image.attributes['quarto-caption-env'] = 'subcaption'
186- -- end
187- -- image.classes:extend(figure.classes)
188- -- if state.in_column_margin then
189- -- image.classes:insert("column-margin")
190- -- end
191- -- return latexImageFigure(image)
192- -- end
193- -- local function float_renderer(float)
194- -- local count = 0
195- -- local new_content = _quarto.ast.walk(float.content, {
196- -- Figure = function(fig)
197- -- count = count + 1
198- -- return figure_renderer(fig, true), false
199- -- end
200- -- })
201- -- if count > 0 then
202- -- float.content = new_content
203- -- return float, false
204- -- end
205- -- end
206- -- return {
207- -- traverse = "topdown",
208- -- PanelLayout = function(panel)
209- -- panel.rows = _quarto.ast.walk(panel.rows, {
210- -- Figure = function(fig)
211- -- return figure_renderer(fig, true), false
212- -- end
213- -- })
214- -- return panel, false
215- -- end,
216- -- FloatRefTarget = float_renderer,
217- -- Div = function(div)
218- -- if div.classes:includes("column-margin") then
219- -- local new_state = {}
220- -- for k, v in pairs(state) do
221- -- new_state[k] = v
222- -- end
223- -- new_state.in_column_margin = true
224-
225- -- div.content = _quarto.ast.walk(div.content, filter(new_state))
226- -- div.classes = div.classes:filter(function(x) return x ~= "column-margin" end)
227- -- return div
228- -- end
229- -- end,
230- -- Figure = function(figure)
231- -- return figure_renderer(figure, false)
232- -- end
233- -- }
234- -- end
235- -- return filter()
236151 elseif _quarto .format .isTypstOutput () then
237152 return {
238153 traverse = " topdown" ,
0 commit comments