File tree Expand file tree Collapse file tree 2 files changed +16
-6
lines changed
resources/filters/crossref Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ import {
4343 isHtmlOutput ,
4444 isIpynbOutput ,
4545 isLatexOutput ,
46+ isMarkdownOutput ,
4647} from "../../config/format.ts" ;
4748import {
4849 isIncludeMetadata ,
@@ -636,7 +637,10 @@ export async function runPandoc(
636637 // remove selected args and defaults if we are handling some things on behalf of pandoc
637638 // (e.g. handling section numbering). note that section numbering is handled by the
638639 // crossref filter so we only do this if the user hasn't disabled the crossref filter
639- if ( ! isLatexOutput ( options . format . pandoc ) && crossrefFilterActive ( options ) ) {
640+ if (
641+ ! isLatexOutput ( options . format . pandoc ) &&
642+ ! isMarkdownOutput ( options . format . pandoc ) && crossrefFilterActive ( options )
643+ ) {
640644 delete allDefaults [ kNumberSections ] ;
641645 delete allDefaults [ kNumberOffset ] ;
642646 const removeArgs = new Map < string , boolean > ( ) ;
Original file line number Diff line number Diff line change @@ -61,10 +61,14 @@ function sections()
6161 el .content :insert (1 , pandoc .Space ())
6262 end
6363
64- el .content :insert (1 , pandoc .Span (
65- stringToInlines (section ),
66- pandoc .Attr (" " , { " header-section-number" })
67- ))
64+ if _quarto .format .isHtmlOutput () then
65+ el .content :insert (1 , pandoc .Span (
66+ stringToInlines (section ),
67+ pandoc .Attr (" " , { " header-section-number" })
68+ ))
69+ else
70+ tprepend (el .content , stringToInlines (section ))
71+ end
6872
6973 if appendix then
7074 el .content :insert (1 , pandoc .Space ())
@@ -93,7 +97,9 @@ function currentSectionLevel()
9397end
9498
9599function numberSections ()
96- return not _quarto .format .isLatexOutput () and numberSectionsOptionEnabled ()
100+ return not _quarto .format .isLatexOutput () and
101+ not _quarto .format .isMarkdownOutput ()
102+ and numberSectionsOptionEnabled ()
97103end
98104
99105function numberSectionsOptionEnabled ()
You can’t perform that action at this time.
0 commit comments