aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2020-11-24 15:42:19 +0100
committerAlbert Krewinkel <albert@zeitkraut.de>2020-11-24 15:46:11 +0100
commit0eedbd0a3de51450df5fb940ea6059115001ee44 (patch)
treedb53a31c928c16f96382bef57a95e1b03d0717e9
parentc9f98e2bf5635564bbd83f97c32567dea121d317 (diff)
downloadpandoc-0eedbd0a3de51450df5fb940ea6059115001ee44.tar.gz
HTML reader tests: disable round-trip testing for tables
Information for cell alignment in a column is not preserved during round-trips.
-rw-r--r--test/Tests/Readers/HTML.hs14
1 files changed, 3 insertions, 11 deletions
diff --git a/test/Tests/Readers/HTML.hs b/test/Tests/Readers/HTML.hs
index b9fe8b501..e4c681421 100644
--- a/test/Tests/Readers/HTML.hs
+++ b/test/Tests/Readers/HTML.hs
@@ -21,8 +21,7 @@ import Test.Tasty.QuickCheck
import Test.Tasty.Options (IsOption(defaultValue))
import Tests.Helpers
import Text.Pandoc
-import Text.Pandoc.Writers.Shared (toLegacyTable)
-import Text.Pandoc.Shared (isHeaderBlock, onlySimpleTableCells)
+import Text.Pandoc.Shared (isHeaderBlock)
import Text.Pandoc.Arbitrary ()
import Text.Pandoc.Builder
import Text.Pandoc.Walk (walk)
@@ -40,14 +39,7 @@ 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 b@(Table _attr blkCapt specs thead tbody tfoot) =
- let (_capt, _aligns, widths, headers, rows') =
- toLegacyTable blkCapt specs thead tbody tfoot
- isSimple = onlySimpleTableCells (headers:rows')
- in
- if all (== 0.0) widths && not isSimple
- then Para [Str "weird table omitted"]
- else b
+makeRoundTrip Table{} = Para [Str "table block was here"]
makeRoundTrip x = x
removeRawInlines :: Inline -> Inline
@@ -61,7 +53,7 @@ roundTrip b = d'' == d'''
d' = rewrite d
d'' = rewrite d'
d''' = rewrite d''
- rewrite = html . T.pack . (++ "\n") . T.unpack .
+ rewrite = html . (`T.snoc` '\n') .
purely (writeHtml5String def
{ writerWrapText = WrapPreserve })