diff options
| author | damon-sava-stanley <damonsava@gmail.com> | 2022-02-11 11:58:29 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-11 08:58:29 -0800 |
| commit | d3716eaeb6d0f2e0be549baf0a346cba1e5a4ff0 (patch) | |
| tree | 02772b2f47fb6fa61571414c0c6b7221d93150ec /test | |
| parent | 61996682ffc15dc4f8d7cb820973dd0365056957 (diff) | |
Add DokuWiki table alignment for #5202 (#7908)
Closes #5202.
Within each cell, determine the cell alignment as per
https://www.dokuwiki.org/wiki:syntax#tables. The current approach, as
per the issue treats the first row's alignment as determining
that of the entire column. Given this, it wastes some work in
determining an alignment for every cell.
Diffstat (limited to 'test')
| -rw-r--r-- | test/Tests/Readers/DokuWiki.hs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Tests/Readers/DokuWiki.hs b/test/Tests/Readers/DokuWiki.hs index 84ba86d46..db52a34a6 100644 --- a/test/Tests/Readers/DokuWiki.hs +++ b/test/Tests/Readers/DokuWiki.hs @@ -1,5 +1,6 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TupleSections #-} {- | Module : Tests.Readers.DokuWiki Copyright : © 2018-2020 Alexander Krotov @@ -300,6 +301,17 @@ tests = [ testGroup "inlines" , "| bat | baz |" ] =?> simpleTable [plain "foo", plain "bar"] [[plain "bat", plain "baz"]] + , "Table with alignment" =: + T.unlines [ "^ 0 ^ 1 ^ 2 ^ 3 ^" + , "| a | b | c |d |" + ] =?> + table emptyCaption + (map (, ColWidthDefault) [AlignLeft, AlignCenter, AlignRight, AlignDefault]) + (TableHead nullAttr + [Row nullAttr . map (simpleCell . plain) $ ["0", "1", "2", "3"]]) + [TableBody nullAttr 0 [] + [Row nullAttr . map (simpleCell . plain) $ ["a", "b", "c", "d"]]] + (TableFoot nullAttr []) , "Table with colspan" =: T.unlines [ "^ 0,0 ^ 0,1 ^ 0,2 ^" , "| 1,0 | 1,1 ||" |
