Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/resources/filters/customnodes/shortcodes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ function shortcodes_filter()
})

local block_handler = function(node)
if node.t == "Para" and #node.content == 1 then
node = node.content[1]
end
local custom_data, t, kind = _quarto.ast.resolve_custom_data(node)
if t ~= "Shortcode" then
return nil
Expand Down
16 changes: 16 additions & 0 deletions tests/docs/smoke-all/2023/05/24/5661-html.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
title: "Callout-test Example"
format:
html: default
_quarto:
tests:
html:
ensureHtmlElements:
- ["div.callout"]
- []
---

## Heading

{{< callout-test >}}

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
title: Callout-test
author: Pascal Burkhard
version: 1.0.0
quarto-required: ">=1.3.0"
contributes:
shortcodes:
- callout-test.lua

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
return {
['callout-test'] = function(args, kwargs, meta)
local calloutDiv = {}
calloutDiv["type"] = "note"
calloutDiv["icon"] = false
calloutDiv["title"] = "Test"
calloutDiv["content"] = { pandoc.Str("This is a test.") }

calloutOut = quarto.Callout(calloutDiv)

return calloutOut
end
}