Files
John MacFarlane 01257ef6eb T.P.Writers.Shared: New version of gridTable.
This handles row and colspans. Partially addresses #6344.

It also ensures that cells won't wrap text in places where it
wouldn't normally wrap, even if this means making the cells wider
than requested by the colspec. (Closes #9001.  Closes 7641.)

Parameters are different, so this is a breaking [API change].

Markdown, RST, and Muse writers have been adjusted to
use the new `gridTable`.
2025-05-14 14:31:39 -07:00

2.1 KiB

Correctly handle empty row:

% pandoc -f markdown -t rst
+---+---+
| 1 | 2 |
+---+---+
|   |   |
+---+---+
^D
+---+---+
| 1 | 2 |
+---+---+
|   |   |
+---+---+

Temporarily added these to figure out what is happening on Windows builds.

% pandoc -f markdown -t native
+---+---+
| 1 | 2 |
+---+---+
|   |   |
+---+---+
^D
[ Table
    ( "" , [] , [] )
    (Caption Nothing [])
    [ ( AlignDefault , ColWidth 5.555555555555555e-2 )
    , ( AlignDefault , ColWidth 5.555555555555555e-2 )
    ]
    (TableHead ( "" , [] , [] ) [])
    [ TableBody
        ( "" , [] , [] )
        (RowHeadColumns 0)
        []
        [ Row
            ( "" , [] , [] )
            [ Cell
                ( "" , [] , [] )
                AlignDefault
                (RowSpan 1)
                (ColSpan 1)
                [ Plain [ Str "1" ] ]
            , Cell
                ( "" , [] , [] )
                AlignDefault
                (RowSpan 1)
                (ColSpan 1)
                [ Plain [ Str "2" ] ]
            ]
        , Row
            ( "" , [] , [] )
            [ Cell
                ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []
            , Cell
                ( "" , [] , [] ) AlignDefault (RowSpan 1) (ColSpan 1) []
            ]
        ]
    ]
    (TableFoot ( "" , [] , [] ) [])
]
% pandoc -f native -t rst
[Table ("",[],[]) (Caption Nothing
 [])
 [(AlignDefault,ColWidth 5.555555555555555e-2)
 ,(AlignDefault,ColWidth 5.555555555555555e-2)]
 (TableHead ("",[],[])
 [Row ("",[],[])
  [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)
   []
  ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)
   []]])
 [(TableBody ("",[],[]) (RowHeadColumns 0)
  []
  [Row ("",[],[])
   [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)
    [Para [Str "1"]]
   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)
    [Para [Str "2"]]]
  ,Row ("",[],[])
   [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)
    []
   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)
    []]])]
 (TableFoot ("",[],[])
 [])]
^D
+---+---+
|   |   |
+===+===+
| 1 | 2 |
+---+---+
|   |   |
+---+---+