Custom filter for processing Github/Obsidian style callouts stopped working - any tips? #6550
-
DescriptionIn order to process a obsidian/new github style callouts
I added a custom lua filter to my
the filter worked a few months ago with 1.3 and previous pandoc, but now the filter produce empty output (no text from callout) |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 9 replies
-
Can you provide a full example? |
Beta Was this translation helpful? Give feedback.
-
I have now a problem with fully reproducing it. The behaviour I am expecting was working in May (colorful callouts), I even wrote a post about it To partially replicate here are file ---
title: "Untitled"
format: html
filters:
- callouts.lua
---
# Test filter
> [!note] My note
>
> Note content And again the callout included local stringify = (require "pandoc.utils").stringify
function BlockQuote (el)
start = el.content[1]
if (start.t == "Para" and start.content[1].t == "Str" and
start.content[1].text:match("^%[!%w+%][-+]?$")) then
_, _, ctype = start.content[1].text:find("%[!(%w+)%]")
el.content:remove(1)
start.content:remove(1)
div = pandoc.Div(el.content, {class = "callout"})
div.attributes["data-callout"] = ctype:lower()
div.attributes["title"] = stringify(start.content):gsub("^ ", "")
return div
else
return el
end
end The closest what I want to achieve I am getting with Quarto 1.2.475 and v1.1.189 (but previously I was able to get colour and title as well whem those are one of 5 defined in quarto types) ![]() with the corresponding latex (I copying only the body, what is important 1.3 and 1.4 dont' produce tcolorbox)
The latest 1.3 and 1.4 releases render just text without a callout around it
Both rendering from qmd and ipynb gave me the same results, |
Beta Was this translation helpful? Give feedback.
-
@danieltomasz , Is this available as an official extension? |
Beta Was this translation helpful? Give feedback.
Ok, I understand now what you're asking.
Callout
is now a node type in the Quarto AST, and you just need to usequarto.Callout
explicitly:https://quarto.org/docs/prerelease/1.3/custom-ast-nodes/callout.html
I haven't tested t…