Skip to content

Commit 0d0fc8d

Browse files
committed
Remove starting newline in RawBlock of format markdown.
They add no effect prior to Pandoc 3.6.3 are they were collapse. From Pandoc 3.6.3 they are not anymore Related Pandoc change: jgm/pandoc@d9281d1 to solve jgm/pandoc#10477
1 parent 2a45846 commit 0d0fc8d

File tree

4 files changed

+34
-6
lines changed

4 files changed

+34
-6
lines changed

src/resources/extensions/quarto/docusaurus/docusaurus.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ end, function(node)
139139
start.content:insert(pandoc.RawInline("markdown", "]\n"))
140140
admonition:insert(start)
141141
else
142-
admonition:insert(pandoc.RawBlock("markdown", "\n:::" .. node.type))
142+
admonition:insert(pandoc.RawBlock("markdown", ":::" .. node.type))
143143
end
144144
local content = node.content
145145
if type(content) == "table" then

src/resources/filters/customnodes/floatreftarget.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,7 @@ end, function(float)
10511051
local caption_location = cap_location(float)
10521052

10531053
local open_block = pandoc.RawBlock("markdown", "<div id=\"" .. float.identifier .. "\">\n")
1054-
local close_block = pandoc.RawBlock("markdown", "\n</div>")
1054+
local close_block = pandoc.RawBlock("markdown", "</div>")
10551055
local result = pandoc.Blocks({open_block})
10561056
local insert_content = function()
10571057
if pandoc.utils.type(float.content) == "Block" then
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
title: Callouts
3+
format: docusaurus-md
4+
---
5+
6+
7+
8+
9+
:::note[A small note]
10+
11+
You should note that this is a note.
12+
13+
:::
14+
15+
Another one without title
16+
17+
:::warning
18+
19+
You should note that this is a note.
20+
21+
:::

tests/docs/smoke-all/2024/01/18/docusaurus/callouts.qmd

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ format: docusaurus-md
44
_quarto:
55
tests:
66
docusaurus-md:
7-
ensureFileRegexMatches:
8-
- [":::note\\[A small note\\]"]
9-
- []
7+
ensureSnapshotMatches: true
108
---
119

1210
::: {.callout-note}
@@ -15,4 +13,13 @@ _quarto:
1513

1614
You should note that this is a note.
1715

18-
:::
16+
:::
17+
18+
Another one without title
19+
20+
::: {.callout-warning}
21+
22+
You should note that this is a note.
23+
24+
:::
25+

0 commit comments

Comments
 (0)