RST writer: don't emit alignment markers in grid tables.

Closes #10857.
This commit is contained in:
John MacFarlane
2025-05-20 10:18:32 -07:00
parent 97b7d48333
commit f1e64ee0be
3 changed files with 12 additions and 11 deletions
+2 -1
View File
@@ -339,7 +339,8 @@ blockToRST (Table _attrs blkCapt specs thead tbody tfoot) = do
modify $ \st -> st{ stOptions = oldOpts }
return result
opts <- gets stOptions
let renderGrid = gridTable opts blocksToDoc specs thead tbody tfoot
let specs' = map (\(_,width) -> (AlignDefault, width)) specs
renderGrid = gridTable opts blocksToDoc specs' thead tbody tfoot
isSimple = all (== 0) widths && length widths > 1
renderSimple = do
tbl' <- simpleTable opts blocksToDoc headers rows
+8 -8
View File
@@ -462,10 +462,10 @@
, Str "lines."
]
])
[ ( AlignCenter , ColWidth 0.15 )
, ( AlignLeft , ColWidth 0.1375 )
, ( AlignRight , ColWidth 0.1625 )
, ( AlignLeft , ColWidth 0.35 )
[ ( AlignDefault , ColWidth 0.15 )
, ( AlignDefault , ColWidth 0.1375 )
, ( AlignDefault , ColWidth 0.1625 )
, ( AlignDefault , ColWidth 0.35 )
]
(TableHead
( "" , [] , [] )
@@ -606,10 +606,10 @@
, Table
( "" , [] , [] )
(Caption Nothing [])
[ ( AlignCenter , ColWidth 0.15 )
, ( AlignLeft , ColWidth 0.1375 )
, ( AlignRight , ColWidth 0.1625 )
, ( AlignLeft , ColWidth 0.35 )
[ ( AlignDefault , ColWidth 0.15 )
, ( AlignDefault , ColWidth 0.1375 )
, ( AlignDefault , ColWidth 0.1625 )
, ( AlignDefault , ColWidth 0.35 )
]
(TableHead
( "" , [] , [] )
+2 -2
View File
@@ -39,7 +39,7 @@ Multiline table with caption:
+-----------+----------+------------+---------------------------+
| Centered | Left | Right | Default aligned |
| Header | Aligned | Aligned | |
+:=========:+:=========+===========:+:==========================+
+===========+==========+============+===========================+
| First | row | 12.0 | Example of a row that |
| | | | spans multiple lines. |
+-----------+----------+------------+---------------------------+
@@ -53,7 +53,7 @@ Multiline table without caption:
+-----------+----------+------------+---------------------------+
| Centered | Left | Right | Default aligned |
| Header | Aligned | Aligned | |
+:=========:+:=========+===========:+:==========================+
+===========+==========+============+===========================+
| First | row | 12.0 | Example of a row that |
| | | | spans multiple lines. |
+-----------+----------+------------+---------------------------+