From 0eedbd0a3de51450df5fb940ea6059115001ee44 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 24 Nov 2020 15:42:19 +0100 Subject: HTML reader tests: disable round-trip testing for tables Information for cell alignment in a column is not preserved during round-trips. --- test/Tests/Readers/HTML.hs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'test') 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 }) -- cgit v1.2.3