diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-10-12 23:00:27 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-10-12 23:00:27 -0700 |
commit | 24f68654e919a8ff138d0a1fcfbf8e045b8ae38b (patch) | |
tree | c25384e1afcc515f96aff2ae0120f39c4877c48f /tests | |
parent | fb51077712fbe2bca80b52d8e4b5f96b07980dcf (diff) | |
download | pandoc-24f68654e919a8ff138d0a1fcfbf8e045b8ae38b.tar.gz |
RST writer: do header normalization only in "standalone" mode.
If we're producing a fragment, just skip normalization.
After all, the fragment might be somewhere in the middle
of the document. It's more important for fragments to
have consistency in rendering (so they can be pieced
together) than to normalize.
This closes #2394. It's simpler and more robust than
my earlier fix.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Tests/Writers/RST.hs | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/tests/Tests/Writers/RST.hs b/tests/Tests/Writers/RST.hs index bb7b2a446..b9e359dae 100644 --- a/tests/Tests/Writers/RST.hs +++ b/tests/Tests/Writers/RST.hs @@ -46,7 +46,10 @@ tests = [ testGroup "rubrics" unlines [ "foo" , "==="] - , "heading levels" =: + -- note: heading normalization is only done in standalone mode + , test (writeRST def{ writerStandalone = True, + writerTemplate = "$body$\n" } . toPandoc) + "heading levels" $ header 1 (text "Header 1") <> header 3 (text "Header 2") <> header 2 (text "Header 2") <> @@ -75,7 +78,9 @@ tests = [ testGroup "rubrics" , "" , "Header 2" , "--------"] - , "minimal heading levels" =: + , test (writeRST def{ writerStandalone = True, + writerTemplate = "$body$\n" } . toPandoc) + "minimal heading levels" $ header 2 (text "Header 1") <> header 3 (text "Header 2") <> header 2 (text "Header 1") <> @@ -84,21 +89,21 @@ tests = [ testGroup "rubrics" header 3 (text "Header 2") =?> unlines [ "Header 1" - , "--------" + , "========" , "" , "Header 2" - , "~~~~~~~~" + , "--------" , "" , "Header 1" - , "--------" + , "========" , "" , "Header 2" - , "~~~~~~~~" + , "--------" , "" , "Header 3" - , "^^^^^^^^" + , "~~~~~~~~" , "" , "Header 2" - , "~~~~~~~~"] + , "--------"] ] ] |