diff options
author | John MacFarlane <jgm@berkeley.edu> | 2019-12-21 12:15:35 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2019-12-21 12:15:35 -0800 |
commit | 80a0e56a5dba0c1befcf46a2621efcfea18256b3 (patch) | |
tree | 0c4439e5891c54d295316dcfce53d662861cf9e6 | |
parent | f8e85ca4a8e6712488fec9f2c8ae6af5a819ec70 (diff) | |
download | pandoc-80a0e56a5dba0c1befcf46a2621efcfea18256b3.tar.gz |
HTML reader tests: modify round-trip tests...
to avoid a special failure case involving makeSections.
-rw-r--r-- | test/Tests/Readers/HTML.hs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/Tests/Readers/HTML.hs b/test/Tests/Readers/HTML.hs index 31299e40d..189d37945 100644 --- a/test/Tests/Readers/HTML.hs +++ b/test/Tests/Readers/HTML.hs @@ -21,6 +21,7 @@ import Test.Tasty.QuickCheck import Test.Tasty.Options (IsOption(defaultValue)) import Tests.Helpers import Text.Pandoc +import Text.Pandoc.Shared (isHeaderBlock) import Text.Pandoc.Arbitrary () import Text.Pandoc.Builder import Text.Pandoc.Walk (walk) @@ -35,6 +36,9 @@ makeRoundTrip :: Block -> Block makeRoundTrip CodeBlock{} = Para [Str "code block was here"] makeRoundTrip LineBlock{} = Para [Str "line block was here"] makeRoundTrip RawBlock{} = Para [Str "raw block was here"] +makeRoundTrip (Div attr bs) = Div attr $ filter (not . isHeaderBlock) bs +-- avoids round-trip failures related to makeSections +-- e.g. with [Div ("loc",[],[("a","11"),("b_2","a b c")]) [Header 3 ("",[],[]) []]] makeRoundTrip x = x removeRawInlines :: Inline -> Inline |