diff options
| author | Brian Leung <29217594+leungbk@users.noreply.github.com> | 2022-05-02 08:25:57 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-02 17:25:57 +0200 |
| commit | 67daf96bdd519b1e709d6ed2534d06203967bf97 (patch) | |
| tree | 94a3ace6f960e26e772c00437f3ff9af7112f2b3 /test/Tests | |
| parent | 843eeae13d4cb2a7e8c1ed0d151a691c83adf72f (diff) | |
Org reader: allow attrs for Org tables. (#8049)
Tables with attributes are no longer wrapped in Div elements;
attributes are added directly to the table element.
Diffstat (limited to 'test/Tests')
| -rw-r--r-- | test/Tests/Readers/Org/Block/Table.hs | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/test/Tests/Readers/Org/Block/Table.hs b/test/Tests/Readers/Org/Block/Table.hs index 5a9320b4a..f6b99a5c1 100644 --- a/test/Tests/Readers/Org/Block/Table.hs +++ b/test/Tests/Readers/Org/Block/Table.hs @@ -25,12 +25,16 @@ simpleTable' :: Int simpleTable' n = simpleTable'' emptyCaption $ replicate n (AlignDefault, ColWidthDefault) simpleTable'' :: Caption -> [ColSpec] -> [Blocks] -> [[Blocks]] -> Blocks -simpleTable'' capt spec headers rows - = table capt - spec - (TableHead nullAttr $ toHeaderRow headers) - [TableBody nullAttr 0 [] $ map toRow rows] - (TableFoot nullAttr []) +simpleTable'' = simpleTableWith'' (mempty, [], []) + +simpleTableWith'' :: Attr -> Caption -> [ColSpec] -> [Blocks] -> [[Blocks]] -> Blocks +simpleTableWith'' attr capt spec headers rows + = tableWith attr + capt + spec + (TableHead nullAttr $ toHeaderRow headers) + [TableBody nullAttr 0 [] $ map toRow rows] + (TableFoot nullAttr []) where toRow = Row nullAttr . map simpleCell toHeaderRow l = [toRow l | not (null l)] @@ -181,6 +185,9 @@ tests = T.unlines [ "#+name: x-marks-the-spot" , "| x |" ] =?> - divWith ("x-marks-the-spot", mempty, mempty) - (simpleTable' 1 mempty [ [ plain "x" ] ]) + simpleTableWith'' ("x-marks-the-spot", mempty, mempty) + emptyCaption + (replicate 1 (AlignDefault, ColWidthDefault)) + mempty + [ [ plain "x" ] ] ] |
