aboutsummaryrefslogtreecommitdiff
path: root/test/Tests
diff options
context:
space:
mode:
authorAner Lucero <4rgento@gmail.com>2020-11-14 20:09:44 -0300
committerJohn MacFarlane <jgm@berkeley.edu>2020-11-14 21:33:32 -0800
commitf63b76e1698b0d7eba6b43ef45faaeee2b01b9ca (patch)
tree58e6458690ab189e00c15b98ccb88e440c97e396 /test/Tests
parentb8d17f7ae8ed37784adcfaa4f89d0d28f52fffff (diff)
downloadpandoc-f63b76e1698b0d7eba6b43ef45faaeee2b01b9ca.tar.gz
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.
Diffstat (limited to 'test/Tests')
-rw-r--r--test/Tests/Old.hs6
-rw-r--r--test/Tests/Writers/Markdown.hs4
2 files changed, 7 insertions, 3 deletions
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