File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
src/resources/filters/customnodes
tests/docs/smoke-all/2023/04/06 Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,22 @@ _quarto.ast.add_handler({
103103 return listingDiv
104104 end
105105 return el
106+ elseif _quarto .format .isMarkdownOutput () then
107+ -- see https://github.com/quarto-dev/quarto-cli/issues/5112
108+ --
109+ -- This is a narrow fix for the 1.3 regression.
110+ -- We still don't support listings output in markdown since that wasn't supported in 1.2 either.
111+ -- But that'll be done in 1.4 with crossrefs overhaul.
112+
113+ if node .filename then
114+ -- if we have a filename, add it as a header
115+ return pandoc .Div (
116+ { pandoc .Plain {pandoc .Strong {pandoc .Str (node .filename )}}, el },
117+ pandoc .Attr (" " , {" code-with-filename" })
118+ )
119+ else
120+ return el
121+ end
106122 else
107123 -- return the code block unadorned
108124 -- this probably could be improved
Original file line number Diff line number Diff line change 1+ ---
2+ title : foo
3+ format : commonmark
4+ keep-md : true
5+ _quarto :
6+ tests :
7+ commonmark :
8+ ensureFileRegexMatches :
9+ - ["this-is-the-filename.py"]
10+ - []
11+ ---
12+
13+ ``` {.python filename="this-is-the-filename.py"}
14+ import matplotlib.pyplot as plt
15+ plt.plot([1,23,2,4])
16+ plt.show()
17+ ```
You can’t perform that action at this time.
0 commit comments