From f63b76e1698b0d7eba6b43ef45faaeee2b01b9ca Mon Sep 17 00:00:00 2001 From: Aner Lucero <4rgento@gmail.com> Date: Sat, 14 Nov 2020 20:09:44 -0300 Subject: 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. --- test/Tests/Old.hs | 6 ++++-- test/Tests/Writers/Markdown.hs | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'test/Tests') diff --git a/test/Tests/Old.hs b/test/Tests/Old.hs index d1d27d9a5..2eb9e9cb0 100644 --- a/test/Tests/Old.hs +++ b/test/Tests/Old.hs @@ -215,7 +215,8 @@ tests pandocPath = [ test' "reader" ["-f", "ipynb-raw_html-raw_tex+raw_attribute", "-t", "native", "-s"] "ipynb/simple.ipynb" "ipynb/simple.out.native" - , test' "writer" ["-f", "native", "-t", + , test' "writer" ["-f", "native", + "--markdown-headings=setext", "-t", "ipynb-raw_html-raw_tex+raw_attribute", "-s"] "ipynb/simple.in.native" "ipynb/simple.ipynb" ] @@ -241,7 +242,8 @@ lhsWriterTests pandocPath format ] where t n f = test pandocPath - n ["--wrap=preserve", "-r", "native", "-s", "-w", f] + n ["--wrap=preserve", "-r", "native", "-s", + "--markdown-headings=setext", "-w", f] "lhs-test.native" ("lhs-test" <.> f) lhsReaderTest :: FilePath -> String -> TestTree diff --git a/test/Tests/Writers/Markdown.hs b/test/Tests/Writers/Markdown.hs index 00f883ecb..4b819de24 100644 --- a/test/Tests/Writers/Markdown.hs +++ b/test/Tests/Writers/Markdown.hs @@ -12,7 +12,9 @@ import Text.Pandoc.Arbitrary () import Text.Pandoc.Builder defopts :: WriterOptions -defopts = def{ writerExtensions = pandocExtensions } +defopts = def + { writerExtensions = pandocExtensions + , writerSetextHeaders = True } markdown :: (ToPandoc a) => a -> String markdown = unpack . purely (writeMarkdown defopts) . toPandoc -- cgit v1.2.3