@@ -740,11 +740,11 @@ lineBlockLines = try $ do
740-- | Parse a table using 'headerParser', 'rowParser',
740-- | Parse a table using 'headerParser', 'rowParser',
741-- 'lineParser', and 'footerParser'.
741-- 'lineParser', and 'footerParser'.
742tableWith :: Stream s m Char
742tableWith :: Stream s m Char
743− => ParserT s ParserState m ([[Block]], [Alignment], [Int])
743+ => ParserT s ParserState m ([Blocks], [Alignment], [Int])
744− -> ([Int] -> ParserT s ParserState m [[Block]])
744+ -> ([Int] -> ParserT s ParserState m [Blocks])
745 -> ParserT s ParserState m sep
745 -> ParserT s ParserState m sep
746 -> ParserT s ParserState m end
746 -> ParserT s ParserState m end
747− -> ParserT s ParserState m Block
747+ -> ParserT s ParserState m Blocks
748tableWith headerParser rowParser lineParser footerParser = try $ do
748tableWith headerParser rowParser lineParser footerParser = try $ do
749 (heads, aligns, indices) <- headerParser
749 (heads, aligns, indices) <- headerParser
750 lines' <- rowParser indices `sepEndBy1` lineParser
750 lines' <- rowParser indices `sepEndBy1` lineParser
@@ -753,7 +753,7 @@ tableWith headerParser rowParser lineParser footerParser = try $ do
753 let widths = if (indices == [])
753 let widths = if (indices == [])
754 then replicate (length aligns) 0.0
754 then replicate (length aligns) 0.0
755 else widthsFromIndices numColumns indices
755 else widthsFromIndices numColumns indices
756− return $ Table [] aligns widths heads lines'
756+ return $ B.table mempty (zip aligns widths) heads lines'
758-- Calculate relative widths of table columns, based on indices
758-- Calculate relative widths of table columns, based on indices
759widthsFromIndices :: Int -- Number of columns on terminal
759widthsFromIndices :: Int -- Number of columns on terminal
@@ -787,9 +787,9 @@ widthsFromIndices numColumns' indices =
787-- which may be grid, separated by blank lines, and
787-- which may be grid, separated by blank lines, and
788-- ending with a footer (dashed line followed by blank line).
788-- ending with a footer (dashed line followed by blank line).
789gridTableWith :: Stream [Char] m Char
789gridTableWith :: Stream [Char] m Char
790− => ParserT [Char] ParserState m [Block] -- ^ Block list parser
790+ => ParserT [Char] ParserState m Blocks -- ^ Block list parser
791 -> Bool -- ^ Headerless table
791 -> Bool -- ^ Headerless table
792− -> ParserT [Char] ParserState m Block
792+ -> ParserT [Char] ParserState m Blocks
793gridTableWith blocks headless =
793gridTableWith blocks headless =
794 tableWith (gridTableHeader headless blocks) (gridTableRow blocks)
794 tableWith (gridTableHeader headless blocks) (gridTableRow blocks)
795 (gridTableSep '-') gridTableFooter
795 (gridTableSep '-') gridTableFooter
@@ -818,8 +818,8 @@ gridTableSep ch = try $ gridDashedLines ch >> return '\n'
818-- | Parse header for a grid table.
818-- | Parse header for a grid table.
819gridTableHeader :: Stream [Char] m Char
819gridTableHeader :: Stream [Char] m Char
820 => Bool -- ^ Headerless table
820 => Bool -- ^ Headerless table
821− -> ParserT [Char] ParserState m [Block]
821+ -> ParserT [Char] ParserState m Blocks
822− -> ParserT [Char] ParserState m ([[Block]], [Alignment], [Int])
822+ -> ParserT [Char] ParserState m ([Blocks], [Alignment], [Int])
823gridTableHeader headless blocks = try $ do
823gridTableHeader headless blocks = try $ do
824 optional blanklines
824 optional blanklines
825 dashes <- gridDashedLines '-'
825 dashes <- gridDashedLines '-'
@@ -850,9 +850,9 @@ gridTableRawLine indices = do
851-- | Parse row of grid table.
851-- | Parse row of grid table.
852gridTableRow :: Stream [Char] m Char
852gridTableRow :: Stream [Char] m Char
853− => ParserT [Char] ParserState m [Block]
853+ => ParserT [Char] ParserState m Blocks
855− -> ParserT [Char] ParserState m [[Block]]
855+ -> ParserT [Char] ParserState m [Blocks]
856gridTableRow blocks indices = do
856gridTableRow blocks indices = do
857 colLines <- many1 (gridTableRawLine indices)
857 colLines <- many1 (gridTableRawLine indices)
858 let cols = map ((++ "\n") . unlines . removeOneLeadingSpace) $
858 let cols = map ((++ "\n") . unlines . removeOneLeadingSpace) $
@@ -867,8 +867,8 @@ removeOneLeadingSpace xs =
867 where startsWithSpace "" = True
867 where startsWithSpace "" = True
868 startsWithSpace (y:_) = y == ' '
868 startsWithSpace (y:_) = y == ' '
870−compactifyCell :: [Block] -> [Block]
870+compactifyCell :: Blocks -> Blocks
871−compactifyCell bs = head $ compactify [bs]
871+compactifyCell bs = head $ compactify' [bs]
873-- | Parse footer for a grid table.
873-- | Parse footer for a grid table.
874gridTableFooter :: Stream s m Char => ParserT s ParserState m [Char]
874gridTableFooter :: Stream s m Char => ParserT s ParserState m [Char]