Skip to content

Custom filter for processing Github/Obsidian style callouts stopped working - any tips? #6550

Answered by cscheid
danieltomasz asked this question in Q&A
Discussion options

You must be logged in to vote

Ok, I understand now what you're asking. Callout is now a node type in the Quarto AST, and you just need to use quarto.Callout explicitly:

https://quarto.org/docs/prerelease/1.3/custom-ast-nodes/callout.html

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)
        return quarto.Callout({
            type = ctype:lower(),
            title = stringify(start.content):gsub("^ ", "")
            content = el.content
        })
    else
        return el
    end

I haven't tested t…

Replies: 3 comments 9 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@cscheid
Comment options

Answer selected by danieltomasz
@danieltomasz
Comment options

@danieltomasz
Comment options

@cscheid
Comment options

@cscheid
Comment options

Comment options

You must be logged in to vote
2 replies
@danieltomasz
Comment options

@f0nzie
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
extensions relates to Quarto extensions mechanism lua Issues related to the lua codebase, filter chain, etc
4 participants