Skip to content

Commit 80bba69

Browse files
committed
inline snippet caption if using the first slice
1 parent 371031f commit 80bba69

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Sources/MarkdownSemantics/AST/Media/Markdown.BlockCodeFragment.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,15 @@ extension Markdown.BlockCodeFragment
123123

124124
if let slice:String = self.slice
125125
{
126+
// If this is the first slice, we should also inline the caption.
127+
if case slice? = snippet.slices.keys.first
128+
{
129+
for block:Markdown.BlockElement in snippet.caption
130+
{
131+
yield(block)
132+
}
133+
}
134+
126135
if let slice:Markdown.SnippetSlice = snippet.slices[slice]
127136
{
128137
yield(Markdown.BlockCodeLiteral.init(bytecode: slice.code))

0 commit comments

Comments
 (0)