git.iko.soy/typeable/pandoc
on master help sign in
Markdown writer: default to using ATX headings.

Previously we used Setext (underlined) headings by default. The default is now ATX (`##` style). * Add the `--markdown-headings=atx|setext` option. * Deprecate `--atx-headers`. * Add constructor 'ATXHeadingInLHS` constructor to `LogMessage` [API change]. * Support `markdown-headings` in defaults files. * Document new options in MANUAL. Closes #6662.

commitf63b76e1698b0d7eba6b43ef45faaeee2b01b9ca authorAner Lucero <4rgento@gmail.com> dateSat 14 Nov 2020, 20:09 (6 years ago) parentb8d17f7
36 files changed+202−194
MANUAL.txt+12−7 src/Text/Pandoc/App/CommandLineOptions.hs+18−1 src/Text/Pandoc/App/Opt.hs+7−1 src/Text/Pandoc/Logging.hs+49−36 src/Text/Pandoc/Options.hs+1−1 src/Text/Pandoc/Writers/Markdown.hs+6−1 test/Tests/Old.hs+4−2 test/Tests/Writers/Markdown.hs+3−1 test/command/3674.md+1−1 test/command/3736.md+3−6 test/command/4038.md+1−1 test/command/4164.md+4−8 test/command/5121.md+1−2 test/command/6723.md+1−2 test/command/6837.md+29 test/command/pandoc-citeproc-119.md+1−2 test/command/pandoc-citeproc-14.md+1−2 test/command/pandoc-citeproc-152.md+2−4 test/command/pandoc-citeproc-160.md+2−4 test/command/pandoc-citeproc-175.md+2−4 test/command/pandoc-citeproc-213.md+1−2 test/command/pandoc-citeproc-25.md+1−2 test/command/pandoc-citeproc-27.md+1−2 test/command/pandoc-citeproc-371.md+1−2 test/command/pandoc-citeproc-416.md+1−2 test/command/pandoc-citeproc-47.md+1−2 test/command/pandoc-citeproc-57.md+1−2 test/command/pandoc-citeproc-58.md+1−2 test/command/pandoc-citeproc-61.md+2−4 test/command/pandoc-citeproc-82.md+1−2 test/command/pandoc-citeproc-87.md+1−2 test/command/pandoc-citeproc-chicago-author-date.md+2−4 test/command/pandoc-citeproc-chicago-fullnote-bibliography.md+2−4 test/command/pandoc-citeproc-ieee.md+2−4 test/command/toc.md+9−18 test/writer.markdown+27−54
MANUAL.txt+12−7
@@ -963,21 +963,26 @@ header when requesting a document from a URL:
963963 placement of link references is affected by the
964964 `--reference-location` option.
965965
966−`--reference-location = block`|`section`|`document`
966+`--reference-location=block`|`section`|`document`
967967
968968: Specify whether footnotes (and references, if `reference-links` is
969969 set) are placed at the end of the current (top-level) block, the
970970 current section, or the document. The default is
971971 `document`. Currently only affects the markdown writer.
972972
973+`--markdown-headings=setext`|`atx
974+
975+: Specify whether to use ATX-style (`#`-prefixed) or
976+ Setext-style (underlined) headings for level 1 and 2
977+ headings in Markdown output. (ATX is the default.)
978+ ATX headings are always used for levels 3+.
979+ This option also affects Markdown cells in `ipynb` output.
980+
973981`--atx-headers`
974982
975−: Use ATX-style headings in Markdown output. The default is
976− to use setext-style headings for levels 1 to 2, and then ATX headings.
977− (Note: for `gfm` output, ATX headings are always used.)
978− This option also affects markdown cells in `ipynb` output.
983+: *Deprecated synonym for `--markdown-headings=atx`.*
979984
980−`--top-level-division=[default|section|chapter|part]`
985+`--top-level-division=default`|`section`|`chapter`|`part`
981986
982987: Treat top-level headings as the given division type in LaTeX, ConTeXt,
983988 DocBook, and TEI output. The hierarchy order is part, chapter, then section;
@@ -1624,7 +1629,7 @@ epub-cover-image: cover.jpg
16241629reference-links: true
16251630# block, section, or document
16261631reference-location: block
1627−atx-headers: false
1632+markdown-headings: setext
16281633
16291634# accept, reject, or all
16301635track-changes: accept
src/Text/Pandoc/App/CommandLineOptions.hs+18−1
@@ -529,9 +529,26 @@ options =
529529
530530 , Option "" ["atx-headers"]
531531 (NoArg
532− (\opt -> return opt { optSetextHeaders = False } ))
532+ (\opt -> do
533+ deprecatedOption "--atx-headers"
534+ "use --markdown-headings=atx"
535+ return opt { optSetextHeaders = False } ))
533536 "" -- "Use atx-style headers for markdown"
534537
538+ , Option "" ["markdown-headings"]
539+ (ReqArg
540+ (\arg opt -> do
541+ headingFormat <- case arg of
542+ "setext" -> pure True
543+ "atx" -> pure False
544+ _ -> E.throwIO $ PandocOptionError $ T.pack
545+ ("Unknown markdown heading format: " ++ arg ++
546+ ". Expecting atx or setext")
547+ pure opt { optSetextHeaders = headingFormat }
548+ )
549+ "setext|atx")
550+ ""
551+
535552 , Option "" ["listings"]
536553 (NoArg
537554 (\opt -> return opt { optListings = True }))
src/Text/Pandoc/App/Opt.hs+7−1
@@ -330,6 +330,12 @@ doOpt (k',v) = do
330330 parseYAML v >>= \x -> return (\o -> o{ optSlideLevel = x })
331331 "atx-headers" ->
332332 parseYAML v >>= \x -> return (\o -> o{ optSetextHeaders = not x })
333+ "markdown-headings" ->
334+ parseYAML v >>= \x -> return (\o ->
335+ case (T.toLower x) of
336+ "atx" -> o{ optSetextHeaders = False }
337+ "setext" -> o{ optSetextHeaders = True }
338+ _ -> o)
333339 "ascii" ->
334340 parseYAML v >>= \x -> return (\o -> o{ optAscii = x })
335341 "default-image-extension" ->
@@ -469,7 +475,7 @@ defaultOpts = Opt
469475 , optPdfEngine = Nothing
470476 , optPdfEngineOpts = []
471477 , optSlideLevel = Nothing
472− , optSetextHeaders = True
478+ , optSetextHeaders = False
473479 , optAscii = False
474480 , optDefaultImageExtension = ""
475481 , optExtractMedia = Nothing
src/Text/Pandoc/Logging.hs+49−36
@@ -31,6 +31,7 @@ import Data.Aeson.Encode.Pretty (Config (..), defConfig, encodePretty',
3131import qualified Data.ByteString.Lazy as BL
3232import Data.Data (Data, toConstr)
3333import qualified Data.Text as Text
34+import Data.Text (Text)
3435import Data.Typeable (Typeable)
3536import GHC.Generics (Generic)
3637import Text.Pandoc.Definition
@@ -59,45 +60,46 @@ instance FromYAML Verbosity where
5960 _ -> mzero
6061
6162data LogMessage =
62− SkippedContent Text.Text SourcePos
63− | IgnoredElement Text.Text
64− | DuplicateLinkReference Text.Text SourcePos
65− | DuplicateNoteReference Text.Text SourcePos
66− | NoteDefinedButNotUsed Text.Text SourcePos
67− | DuplicateIdentifier Text.Text SourcePos
68− | ReferenceNotFound Text.Text SourcePos
69− | CircularReference Text.Text SourcePos
70− | UndefinedToggle Text.Text SourcePos
71− | ParsingUnescaped Text.Text SourcePos
72− | CouldNotLoadIncludeFile Text.Text SourcePos
73− | MacroAlreadyDefined Text.Text SourcePos
63+ SkippedContent Text SourcePos
64+ | IgnoredElement Text
65+ | DuplicateLinkReference Text SourcePos
66+ | DuplicateNoteReference Text SourcePos
67+ | NoteDefinedButNotUsed Text SourcePos
68+ | DuplicateIdentifier Text SourcePos
69+ | ReferenceNotFound Text SourcePos
70+ | CircularReference Text SourcePos
71+ | UndefinedToggle Text SourcePos
72+ | ParsingUnescaped Text SourcePos
73+ | CouldNotLoadIncludeFile Text SourcePos
74+ | MacroAlreadyDefined Text SourcePos
7475 | InlineNotRendered Inline
7576 | BlockNotRendered Block
76− | DocxParserWarning Text.Text
77− | IgnoredIOError Text.Text
78− | CouldNotFetchResource Text.Text Text.Text
79− | CouldNotDetermineImageSize Text.Text Text.Text
80− | CouldNotConvertImage Text.Text Text.Text
81− | CouldNotDetermineMimeType Text.Text
82− | CouldNotConvertTeXMath Text.Text Text.Text
83− | CouldNotParseCSS Text.Text
84− | Fetching Text.Text
85− | Extracting Text.Text
86− | NoTitleElement Text.Text
77+ | DocxParserWarning Text
78+ | IgnoredIOError Text
79+ | CouldNotFetchResource Text Text
80+ | CouldNotDetermineImageSize Text Text
81+ | CouldNotConvertImage Text Text
82+ | CouldNotDetermineMimeType Text
83+ | CouldNotConvertTeXMath Text Text
84+ | CouldNotParseCSS Text
85+ | Fetching Text
86+ | Extracting Text
87+ | NoTitleElement Text
8788 | NoLangSpecified
88− | InvalidLang Text.Text
89− | CouldNotHighlight Text.Text
90− | MissingCharacter Text.Text
91− | Deprecated Text.Text Text.Text
92− | NoTranslation Text.Text
93− | CouldNotLoadTranslations Text.Text Text.Text
94− | UnusualConversion Text.Text
95− | UnexpectedXmlElement Text.Text Text.Text
96− | UnknownOrgExportOption Text.Text
97− | CouldNotDeduceFormat [Text.Text] Text.Text
89+ | InvalidLang Text
90+ | CouldNotHighlight Text
91+ | MissingCharacter Text
92+ | Deprecated Text Text
93+ | NoTranslation Text
94+ | CouldNotLoadTranslations Text Text
95+ | UnusualConversion Text
96+ | UnexpectedXmlElement Text Text
97+ | UnknownOrgExportOption Text
98+ | CouldNotDeduceFormat [Text] Text
9899 | RunningFilter FilePath
99100 | FilterCompleted FilePath Integer
100− | CiteprocWarning Text.Text
101+ | CiteprocWarning Text
102+ | ATXHeadingInLHS Int Text
101103 deriving (Show, Eq, Data, Ord, Typeable, Generic)
102104
103105instance ToJSON LogMessage where
@@ -224,8 +226,11 @@ instance ToJSON LogMessage where
224226 ,"milliseconds" .= Text.pack (show ms) ]
225227 CiteprocWarning msg ->
226228 ["message" .= msg]
229+ ATXHeadingInLHS lvl contents ->
230+ ["level" .= lvl
231+ ,"contents" .= contents]
227232
228−showPos :: SourcePos -> Text.Text
233+showPos :: SourcePos -> Text
229234showPos pos = Text.pack $ sn ++ "line " ++
230235 show (sourceLine pos) ++ " column " ++ show (sourceColumn pos)
231236 where sn = if sourceName pos == "source" || sourceName pos == ""
@@ -238,7 +243,7 @@ encodeLogMessages ms =
238243 keyOrder [ "type", "verbosity", "contents", "message", "path",
239244 "source", "line", "column" ] } ms
240245
241−showLogMessage :: LogMessage -> Text.Text
246+showLogMessage :: LogMessage -> Text
242247showLogMessage msg =
243248 case msg of
244249 SkippedContent s pos ->
@@ -333,6 +338,13 @@ showLogMessage msg =
333338 FilterCompleted fp ms -> "Completed filter " <> Text.pack fp <>
334339 " in " <> Text.pack (show ms) <> " ms"
335340 CiteprocWarning ms -> "Citeproc: " <> ms
341+ ATXHeadingInLHS lvl contents ->
342+ "Rendering heading '" <> contents <> "' as a paragraph.\n" <>
343+ "ATX headings cannot be used in literate Haskell, because " <>
344+ "'#' is not\nallowed in column 1." <>
345+ if lvl < 3
346+ then " Consider using --markdown-headings=setext."
347+ else ""
336348
337349messageVerbosity :: LogMessage -> Verbosity
338350messageVerbosity msg =
@@ -378,3 +390,4 @@ messageVerbosity msg =
378390 RunningFilter{} -> INFO
379391 FilterCompleted{} -> INFO
380392 CiteprocWarning{} -> WARNING
393+ ATXHeadingInLHS{} -> WARNING
src/Text/Pandoc/Options.hs+1−1
@@ -289,7 +289,7 @@ instance Default WriterOptions where
289289 , writerTopLevelDivision = TopLevelDefault
290290 , writerListings = False
291291 , writerHighlightStyle = Just pygments
292− , writerSetextHeaders = True
292+ , writerSetextHeaders = False
293293 , writerEpubSubdirectory = "EPUB"
294294 , writerEpubMetadata = Nothing
295295 , writerEpubFonts = []
src/Text/Pandoc/Writers/Markdown.hs+6−1
@@ -514,6 +514,7 @@ blockToMarkdown' opts b@(RawBlock f str) = do
514514blockToMarkdown' opts HorizontalRule =
515515 return $ blankline <> literal (T.replicate (writerColumns opts) "-") <> blankline
516516blockToMarkdown' opts (Header level attr inlines) = do
517+
517518 -- first, if we're putting references at the end of a section, we
518519 -- put them here.
519520 blkLevel <- asks envBlockLevel
@@ -543,8 +544,12 @@ blockToMarkdown' opts (Header level attr inlines) = do
543544 isEnabled Ext_gutenberg opts
544545 then capitalize inlines
545546 else inlines
547+
546548 let setext = writerSetextHeaders opts
547− hdr = nowrap $ case level of
549+ when (not setext && isEnabled Ext_literate_haskell opts) $
550+ report $ ATXHeadingInLHS level (render Nothing contents)
551+
552+ let hdr = nowrap $ case level of
548553 1 | variant == PlainText ->
549554 if isEnabled Ext_gutenberg opts
550555 then blanklines 3 <> contents <> blanklines 2
test/Tests/Old.hs+4−2
@@ -215,7 +215,8 @@ tests pandocPath =
215215 [ test' "reader" ["-f", "ipynb-raw_html-raw_tex+raw_attribute",
216216 "-t", "native", "-s"]
217217 "ipynb/simple.ipynb" "ipynb/simple.out.native"
218− , test' "writer" ["-f", "native", "-t",
218+ , test' "writer" ["-f", "native",
219+ "--markdown-headings=setext", "-t",
219220 "ipynb-raw_html-raw_tex+raw_attribute", "-s"]
220221 "ipynb/simple.in.native" "ipynb/simple.ipynb"
221222 ]
@@ -241,7 +242,8 @@ lhsWriterTests pandocPath format
241242 ]
242243 where
243244 t n f = test pandocPath
244− n ["--wrap=preserve", "-r", "native", "-s", "-w", f]
245+ n ["--wrap=preserve", "-r", "native", "-s",
246+ "--markdown-headings=setext", "-w", f]
245247 "lhs-test.native" ("lhs-test" <.> f)
246248
247249lhsReaderTest :: FilePath -> String -> TestTree
test/Tests/Writers/Markdown.hs+3−1
@@ -12,7 +12,9 @@ import Text.Pandoc.Arbitrary ()
1212import Text.Pandoc.Builder
1313
1414defopts :: WriterOptions
15−defopts = def{ writerExtensions = pandocExtensions }
15+defopts = def
16+ { writerExtensions = pandocExtensions
17+ , writerSetextHeaders = True }
1618
1719markdown :: (ToPandoc a) => a -> String
1820markdown = unpack . purely (writeMarkdown defopts) . toPandoc
test/command/3674.md+1−1
@@ -2,7 +2,7 @@ Make sure we don't get duplicate reference links, even with
22`--reference-location=section`.
33
44```
5−% pandoc --reference-links -t markdown --reference-location=section --atx-headers
5+% pandoc --reference-links -t markdown --reference-location=section
66# a
77
88![](a)
test/command/3736.md+3−6
@@ -3,8 +3,7 @@
33<h2>hi
44there</h2>
55^D
6−hi there
7−--------
6+## hi there
87```
98
109```
@@ -12,14 +11,12 @@ hi there
1211<h2>hi <em>there
1312again</em></h2>
1413^D
15−hi *there again*
16−----------------
14+## hi *there again*
1715```
1816
1917```
2018% pandoc --wrap=preserve -f html -t markdown
2119<h2>hi<br>there</h2>
2220^D
23−hi there
24−--------
21+## hi there
2522```
test/command/4038.md+1−1
@@ -1,5 +1,5 @@
11```
2−% pandoc -f gfm -t gfm --atx-headers
2+% pandoc -f gfm -t gfm
33# ~~Header~~
44^D
55# ~~Header~~
test/command/4164.md+4−8
@@ -2,11 +2,9 @@
22% pandoc -f opml -t markdown
33<?xml version="1.0"?> <opml version="1.0"> <head> <title> test </title> </head> <body> <outline text="test"> <outline text="try" _note="Here is inline html:&#xA;&#xA;&lt;div&gt; &#xA;&lt;balise&gt;&#xA;bla bla&#xA;&lt;/div&gt;"/> </outline> </body> </opml>
44^D
5−test
6−====
5+# test
76
8−try
9−---
7+## try
108
119Here is inline html:
1210
@@ -22,11 +20,9 @@ Here is inline html:
2220% pandoc -f opml-raw_html-native_divs -t markdown
2321<?xml version="1.0"?> <opml version="1.0"> <head> <title> test </title> </head> <body> <outline text="test"> <outline text="try" _note="Here is inline html:&#xA;&#xA;&lt;div&gt; &#xA;&lt;balise&gt;&#xA;bla bla&#xA;&lt;/div&gt;"/> </outline> </body> </opml>
2422^D
25−test
26−====
23+# test
2724
28−try
29−---
25+## try
3026
3127Here is inline html:
3228
test/command/5121.md+1−2
@@ -8,6 +8,5 @@
88<img src="./my-figure.jpg" width="500" alt="My caption" /><figcaption aria-hidden="true">My caption</figcaption>
99</figure>
1010
11−Header 2
12−--------
11+## Header 2
1312```
test/command/6723.md+1−2
@@ -20,8 +20,7 @@ Blah [@doe].
2020^D
2121Blah.[^1]
2222
23−References {#references .unnumbered}
24−==========
23+# References {#references .unnumbered}
2524
2625::: {#refs .references .csl-bib-body .hanging-indent}
2726::: {#ref-doe .csl-entry}
test/command/6837.mdnew file+29
@@ -0,0 +1,29 @@
1+```
2+% pandoc -t markdown --markdown-headings=setext
3+## Hi
4+
5+### Ok
6+^D
7+Hi
8+--
9+
10+### Ok
11+```
12+
13+```
14+% pandoc -t markdown+lhs
15+# Hi
16+^D
17+[WARNING] Rendering heading 'Hi' as a paragraph.
18+ ATX headings cannot be used in literate Haskell, because '#' is not
19+ allowed in column 1. Consider using --markdown-headings=setext.
20+Hi
21+```
22+
23+```
24+% pandoc -t markdown --markdown-headings=atx
25+Hi
26+--
27+^D
28+## Hi
29+```
test/command/pandoc-citeproc-119.md+1−2
@@ -12,8 +12,7 @@ References {#references .unnumbered}
1212^D
1313Averroes (1982); Averroes (1892); Averroes (1869)
1414
15−References {#references .unnumbered}
16−==========
15+# References {#references .unnumbered}
1716
1817::: {#refs .references .csl-bib-body .hanging-indent line-spacing="2"}
1918::: {#ref-averroes/hercz .csl-entry}
test/command/pandoc-citeproc-14.md+1−2
@@ -54,8 +54,7 @@ References {#references .unnumbered}
5454Foo (Pelikan 1971b, 1:12). Bar (Pelikan 1971c, 1:12). Baz (Pelikan
55551971a, 12).
5656
57−References {#references .unnumbered}
58−==========
57+# References {#references .unnumbered}
5958
6059::: {#refs .references .csl-bib-body .hanging-indent}
6160::: {#ref-CTv1c2 .csl-entry}
test/command/pandoc-citeproc-152.md+2−4
@@ -43,13 +43,11 @@ I have two citations [@Feminism2013gf; @Feminism2011ces].
4343References
4444==========
4545^D
46−Test
47−====
46+# Test
4847
4948I have two citations ("Communities," 2011; "Geek Feminism," 2013).
5049
51−References {#references .unnumbered}
52−==========
50+# References {#references .unnumbered}
5351
5452::: {#refs .references .csl-bib-body .hanging-indent line-spacing="2"}
5553::: {#ref-Feminism2011ces .csl-entry}
test/command/pandoc-citeproc-160.md+2−4
@@ -26,13 +26,11 @@ Expected
2626>
2727> \[Jane11\] Jane Doe. A book. 2011.
2828^D
29−No citation-label
30−-----------------
29+## No citation-label
3130
3231Foo \[Jane11\].
3332
34−Expected
35−--------
33+## Expected
3634
3735> Foo \[Jane11\].
3836>
test/command/pandoc-citeproc-175.md+2−4
@@ -27,13 +27,11 @@ Expected
2727
2828> Doe, Jane. 2011. "A Title." *A Magazine*, January--February.
2929^D
30−Missing en-dash between months
31−------------------------------
30+## Missing en-dash between months
3231
3332Foo (Doe 2011).
3433
35−Expected
36−--------
34+## Expected
3735
3836> Doe, Jane. 2011. "A Title." *A Magazine*, January--February.
3937
test/command/pandoc-citeproc-213.md+1−2
@@ -23,8 +23,7 @@ References {#references .unnumbered}
2323^D
2424Foo (Doe 1999).
2525
26−References {#references .unnumbered}
27−==========
26+# References {#references .unnumbered}
2827
2928::: {#refs .references .csl-bib-body .hanging-indent}
3029::: {#ref-doe1 .csl-entry}
test/command/pandoc-citeproc-25.md+1−2
@@ -20,8 +20,7 @@ References {#references .unnumbered}
2020^D
2121Foo (Author 1998).
2222
23−References {#references .unnumbered}
24−==========
23+# References {#references .unnumbered}
2524
2625::: {#refs .references .csl-bib-body .hanging-indent}
2726::: {#ref-item1 .csl-entry}
test/command/pandoc-citeproc-27.md+1−2
@@ -25,8 +25,7 @@ Minimal example
2525
2626Here is some text that needs a citation [@AuthorOne2014].
2727^D
28−Minimal example
29−===============
28+# Minimal example
3029
3130Here is some text that needs a citation (*1*).
3231
test/command/pandoc-citeproc-371.md+1−2
@@ -26,8 +26,7 @@ References {#references .unnumbered}
2626^D
2727Foo (Doe 2018, in press).
2828
29−References {#references .unnumbered}
30−==========
29+# References {#references .unnumbered}
3130
3231::: {#refs .references .csl-bib-body .hanging-indent}
3332::: {#ref-item2 .csl-entry}
test/command/pandoc-citeproc-416.md+1−2
@@ -42,8 +42,7 @@ references:
4242^D
4343Blah blah (Doe 2010, 2007, 2008).
4444
45−References {#references .unnumbered}
46−==========
45+# References {#references .unnumbered}
4746
4847::: {#refs .references .csl-bib-body .hanging-indent}
4948::: {#ref-item2 .csl-entry}
test/command/pandoc-citeproc-47.md+1−2
@@ -90,8 +90,7 @@ coauthors' last names (regardless of how many coauthors there are)." and
9090chronological order is maintained, regardless of the added abbreviation.
9191\[ed., trans., comp., or whatever\]"
9292
93−References {#references .unnumbered}
94−==========
93+# References {#references .unnumbered}
9594
9695::: {#refs .references .csl-bib-body .hanging-indent}
9796::: {#ref-doe .csl-entry}
test/command/pandoc-citeproc-57.md+1−2
@@ -25,8 +25,7 @@ References
2525^D
2626(Faraday, forthcoming)
2727
28−References {#references .unnumbered}
29−==========
28+# References {#references .unnumbered}
3029
3130::: {#refs .references .csl-bib-body .hanging-indent}
3231::: {#ref-Faraday-forthcoming .csl-entry}
test/command/pandoc-citeproc-58.md+1−2
@@ -22,8 +22,7 @@ References
2222In this item, the title replaces the (unknown) author (see 14.79)
2323(*Stanze in lode della donna brutta* 1547, 12).
2424
25−References {#references .unnumbered}
26−==========
25+# References {#references .unnumbered}
2726
2827::: {#refs .references .csl-bib-body .hanging-indent}
2928::: {#ref-stanze .csl-entry}
test/command/pandoc-citeproc-61.md+2−4
@@ -41,8 +41,7 @@ Foo [@doe, CL, 89]
4141References
4242==========
4343^D
44−Text
45−====
44+# Text
4645
4746Foo[^1]
4847
@@ -54,8 +53,7 @@ Foo[^4]
5453
5554Foo[^5]
5655
57−References {#references .unnumbered}
58−==========
56+# References {#references .unnumbered}
5957
6058::: {#refs .references .csl-bib-body .hanging-indent}
6159::: {#ref-doe .csl-entry}
test/command/pandoc-citeproc-82.md+1−2
@@ -24,8 +24,7 @@ Some text.[^1]
2424
2525[^1]: Comment regarding text, supported by citation [@OCLC_i1099].
2626^D
27−Title
28−=====
27+# Title
2928
3029Some text.[^1]
3130
test/command/pandoc-citeproc-87.md+1−2
@@ -120,8 +120,7 @@ Doe (2006e) -- article-newspaper
120120
121121Doe (2006b) -- article-newspaper YM
122122
123−References {#references .unnumbered}
124−==========
123+# References {#references .unnumbered}
125124
126125::: {#refs .references .csl-bib-body .hanging-indent}
127126::: {#ref-item2a .csl-entry}
test/command/pandoc-citeproc-chicago-author-date.md+2−4
@@ -48,8 +48,7 @@ References {#references .unnumbered}
4848 locator [-@item2 p. 44].
4949^D
5050[WARNING] Citeproc: citation nonexistent not found
51−Pandoc with citeproc-hs
52−=======================
51+# Pandoc with citeproc-hs
5352
5453([**nonexistent?**](#ref-nonexistent))
5554
@@ -82,8 +81,7 @@ Now some modifiers.[^3]
8281
8382With some markup (*see* [Doe 2005, 32](#ref-item1)).
8483
85−References {#references .unnumbered}
86−==========
84+# References {#references .unnumbered}
8785
8886::: {#refs .references .csl-bib-body .hanging-indent}
8987::: {#ref-item1 .csl-entry}
test/command/pandoc-citeproc-chicago-fullnote-bibliography.md+2−4
@@ -49,8 +49,7 @@ References {#references .unnumbered}
4949 [-@item1], and now Doe with a locator [-@item2 p. 44].
5050^D
5151[WARNING] Citeproc: citation nonexistent not found
52−Pandoc with citeproc-hs
53−=======================
52+# Pandoc with citeproc-hs
5453
5554[^1]
5655
@@ -80,8 +79,7 @@ Now some modifiers.[^13]
8079
8180With some markup.[^14]
8281
83−References {#references .unnumbered}
84−==========
82+# References {#references .unnumbered}
8583
8684::: {#refs .references .csl-bib-body .hanging-indent}
8785::: {#ref-item2 .csl-entry}
test/command/pandoc-citeproc-ieee.md+2−4
@@ -49,8 +49,7 @@ References {#references .unnumbered}
4949 locator [-@item2 p. 44].
5050^D
5151[WARNING] Citeproc: citation nonexistent not found
52−Pandoc with citeproc-hs
53−=======================
52+# Pandoc with citeproc-hs
5453
5554[**nonexistent?**](#ref-nonexistent)
5655
@@ -83,8 +82,7 @@ Now some modifiers.[^3]
8382
8483With some markup *see* [\[1, p. 32\]](#ref-item1).
8584
86−References {#references .unnumbered}
87−==========
85+# References {#references .unnumbered}
8886
8987::: {#refs .references .csl-bib-body}
9088::: {#ref-item1 .csl-entry}
test/command/toc.md+9−18
@@ -23,34 +23,25 @@
2323- [E](#e)
2424 - [e](#e-1)
2525
26−A
27−=
26+# A
2827
29−b
30−-
28+## b
3129
32−B
33−=
30+# B
3431
35−b
36−-
32+## b
3733
3834::: {.interior}
39−C
40−=
35+# C
4136
42−cc
43−--
37+## cc
4438
45−D
46−=
39+# D
4740:::
4841
4942::: {.blue}
50−E
51−=
43+# E
5244
53−e
54−-
45+## e
5546:::
5647```
test/writer.markdown+27−54
@@ -11,11 +11,9 @@ markdown test suite.
1111
1212------------------------------------------------------------------------------
1313
14−Headers
15−=======
14+# Headers
1615
17−Level 2 with an [embedded link](/url)
18−-------------------------------------
16+## Level 2 with an [embedded link](/url)
1917
2018### Level 3 with *emphasis*
2119
@@ -23,25 +21,21 @@ Level 2 with an [embedded link](/url)
2321
2422##### Level 5
2523
26−Level 1
27−=======
24+# Level 1
2825
29−Level 2 with *emphasis*
30−-----------------------
26+## Level 2 with *emphasis*
3127
3228### Level 3
3329
3430with no blank line
3531
36−Level 2
37−-------
32+## Level 2
3833
3934with no blank line
4035
4136------------------------------------------------------------------------------
4237
43−Paragraphs
44−==========
38+# Paragraphs
4539
4640Here's a regular paragraph.
4741
@@ -56,8 +50,7 @@ here.
5650
5751------------------------------------------------------------------------------
5852
59−Block Quotes
60−============
53+# Block Quotes
6154
6255E-mail style:
6356
@@ -86,8 +79,7 @@ And a following paragraph.
8679
8780------------------------------------------------------------------------------
8881
89−Code Blocks
90−===========
82+# Code Blocks
9183
9284Code:
9385
@@ -107,11 +99,9 @@ And:
10799
108100------------------------------------------------------------------------------
109101
110−Lists
111−=====
102+# Lists
112103
113−Unordered
114−---------
104+## Unordered
115105
116106Asterisks tight:
117107
@@ -155,8 +145,7 @@ Minuses loose:
155145
156146- Minus 3
157147
158−Ordered
159−-------
148+## Ordered
160149
161150Tight:
162151
@@ -196,8 +185,7 @@ Multiple paragraphs:
196185
1971863. Item 3.
198187
199−Nested
200−------
188+## Nested
201189
202190- Tab
203191 - Tab
@@ -224,8 +212,7 @@ Same thing but with paragraphs:
224212
2252133. Third
226214
227−Tabs and spaces
228−---------------
215+## Tabs and spaces
229216
230217- this is a list item indented with tabs
231218
@@ -235,8 +222,7 @@ Tabs and spaces
235222
236223 - this is an example list item indented with spaces
237224
238−Fancy list markers
239−------------------
225+## Fancy list markers
240226
241227(2) begins with 2
242228
@@ -270,8 +256,7 @@ B. Williams
270256
271257------------------------------------------------------------------------------
272258
273−Definition Lists
274−================
259+# Definition Lists
275260
276261Tight using spaces:
277262
@@ -364,8 +349,7 @@ orange
364349 1. sublist
365350 2. sublist
366351
367−HTML Blocks
368−===========
352+# HTML Blocks
369353
370354Simple block on one line:
371355
@@ -525,8 +509,7 @@ Hr's:
525509
526510------------------------------------------------------------------------------
527511
528−Inline Markup
529−=============
512+# Inline Markup
530513
531514This is *emphasized*, and so *is this*.
532515
@@ -555,8 +538,7 @@ spaces: a\^b c\^d, a\~b c\~d.
555538
556539------------------------------------------------------------------------------
557540
558−Smart quotes, ellipses, dashes
559−==============================
541+# Smart quotes, ellipses, dashes
560542
561543"Hello," said the spider. "'Shelob' is my name."
562544
@@ -577,8 +559,7 @@ Ellipses...and...and....
577559
578560------------------------------------------------------------------------------
579561
580−LaTeX
581−=====
562+# LaTeX
582563
583564- `\cite[22-23]{smith.1899}`{=tex}
584565- $2+2=4$
@@ -610,8 +591,7 @@ Cat & 1 \\ \hline
610591
611592------------------------------------------------------------------------------
612593
613−Special Characters
614−==================
594+# Special Characters
615595
616596Here is some unicode:
617597
@@ -665,11 +645,9 @@ Minus: -
665645
666646------------------------------------------------------------------------------
667647
668−Links
669−=====
648+# Links
670649
671−Explicit
672−--------
650+## Explicit
673651
674652Just a [URL](/url/).
675653
@@ -689,8 +667,7 @@ Just a [URL](/url/).
689667
690668[Empty]().
691669
692−Reference
693−---------
670+## Reference
694671
695672Foo [bar](/url/).
696673
@@ -712,8 +689,7 @@ Foo [bar](/url/ "Title with "quotes" inside").
712689
713690Foo [biz](/url/ "Title with "quote" inside").
714691
715−With ampersands
716−---------------
692+## With ampersands
717693
718694Here's a [link with an ampersand in the URL](http://example.com/?foo=1&bar=2).
719695
@@ -724,8 +700,7 @@ Here's an [inline link](/script?foo=1&bar=2).
724700
725701Here's an [inline link in pointy braces](/script?foo=1&bar=2).
726702
727−Autolinks
728−---------
703+## Autolinks
729704
730705With an ampersand: <http://example.com/?foo=1&bar=2>
731706
@@ -743,8 +718,7 @@ Auto-links should not occur here: `<http://example.com/>`
743718
744719------------------------------------------------------------------------------
745720
746−Images
747−======
721+# Images
748722
749723From "Voyage dans la Lune" by Georges Melies (1902):
750724
@@ -754,8 +728,7 @@ Here is a movie ![movie](movie.jpg) icon.
754728
755729------------------------------------------------------------------------------
756730
757−Footnotes
758−=========
731+# Footnotes
759732
760733Here is a footnote reference,[^1] and another.[^2] This should *not* be a
761734footnote reference, because it contains a space.\[\^my note\] Here is an