git.iko.soy/typeable/pandoc
on master help sign in
Markdown reader: Remove unnecessary qualification
d1521afdespresc
src/Text/Pandoc/Readers/Markdown.hs+8−8
@@ -28,7 +28,7 @@ import qualified Data.Text as T
28import qualified Data.Text.Lazy as TL
28import qualified Data.Text.Lazy as TL
29import qualified Data.ByteString.Lazy as BL
29import qualified Data.ByteString.Lazy as BL
30import System.FilePath (addExtension, takeExtension)
30import System.FilePath (addExtension, takeExtension)
31−import Text.HTML.TagSoup
31+import Text.HTML.TagSoup hiding (Row)
32import Text.Pandoc.Builder (Blocks, Inlines)
32import Text.Pandoc.Builder (Blocks, Inlines)
33import qualified Text.Pandoc.Builder as B
33import qualified Text.Pandoc.Builder as B
34import Text.Pandoc.Class.PandocMonad (PandocMonad (..), report)
34import Text.Pandoc.Class.PandocMonad (PandocMonad (..), report)
@@ -1235,7 +1235,7 @@ tableCaption = try $ do
1235-- Parse a simple table with '---' header and one line per row.
1235-- Parse a simple table with '---' header and one line per row.
1236simpleTable :: PandocMonad m
1236simpleTable :: PandocMonad m
1237 => Bool -- ^ Headerless table
1237 => Bool -- ^ Headerless table
1238− -> MarkdownParser m ([Alignment], [Double], F [Pandoc.Row], F [Pandoc.Row])
1238+ -> MarkdownParser m ([Alignment], [Double], F [Row], F [Row])
1239simpleTable headless = do
1239simpleTable headless = do
1240 (aligns, _widths, heads', lines') <-
1240 (aligns, _widths, heads', lines') <-
1241 tableWith (simpleTableHeader headless) tableLine
1241 tableWith (simpleTableHeader headless) tableLine
@@ -1250,7 +1250,7 @@ simpleTable headless = do
1250-- ending with a footer (dashed line followed by blank line).
1250-- ending with a footer (dashed line followed by blank line).
1251multilineTable :: PandocMonad m
1251multilineTable :: PandocMonad m
1252 => Bool -- ^ Headerless table
1252 => Bool -- ^ Headerless table
1253− -> MarkdownParser m ([Alignment], [Double], F [Pandoc.Row], F [Pandoc.Row])
1253+ -> MarkdownParser m ([Alignment], [Double], F [Row], F [Row])
1254multilineTable headless =
1254multilineTable headless =
1255 tableWith (multilineTableHeader headless) multilineRow blanklines tableFooter
1255 tableWith (multilineTableHeader headless) multilineRow blanklines tableFooter
1256
1256
@@ -1292,7 +1292,7 @@ multilineTableHeader headless = try $ do
1292-- which may be grid, separated by blank lines, and
1292-- which may be grid, separated by blank lines, and
1293-- ending with a footer (dashed line followed by blank line).
1293-- ending with a footer (dashed line followed by blank line).
1294gridTable :: PandocMonad m => Bool -- ^ Headerless table
1294gridTable :: PandocMonad m => Bool -- ^ Headerless table
1295− -> MarkdownParser m ([Alignment], [Double], F [Pandoc.Row], F [Pandoc.Row])
1295+ -> MarkdownParser m ([Alignment], [Double], F [Row], F [Row])
1296gridTable headless = gridTableWith' parseBlocks headless
1296gridTable headless = gridTableWith' parseBlocks headless
1297
1297
1298pipeBreak :: PandocMonad m => MarkdownParser m ([Alignment], [Int])
1298pipeBreak :: PandocMonad m => MarkdownParser m ([Alignment], [Int])
@@ -1307,7 +1307,7 @@ pipeBreak = try $ do
1307 blankline
1307 blankline
1308 return $ unzip (first:rest)
1308 return $ unzip (first:rest)
1309
1309
1310−pipeTable :: PandocMonad m => MarkdownParser m ([Alignment], [Double], F [Pandoc.Row], F [Pandoc.Row])
1310+pipeTable :: PandocMonad m => MarkdownParser m ([Alignment], [Double], F [Row], F [Row])
1311pipeTable = try $ do
1311pipeTable = try $ do
1312 nonindentSpaces
1312 nonindentSpaces
1313 lookAhead nonspaceChar
1313 lookAhead nonspaceChar
@@ -1384,7 +1384,7 @@ tableWith :: PandocMonad m
1384 -> ([Int] -> MarkdownParser m (F [Blocks]))
1384 -> ([Int] -> MarkdownParser m (F [Blocks]))
1385 -> MarkdownParser m sep
1385 -> MarkdownParser m sep
1386 -> MarkdownParser m end
1386 -> MarkdownParser m end
1387− -> MarkdownParser m ([Alignment], [Double], F [Pandoc.Row], F [Pandoc.Row])
1387+ -> MarkdownParser m ([Alignment], [Double], F [Row], F [Row])
1388tableWith headerParser rowParser lineParser footerParser = try $ do
1388tableWith headerParser rowParser lineParser footerParser = try $ do
1389 (heads, aligns, indices) <- headerParser
1389 (heads, aligns, indices) <- headerParser
1390 lines' <- fmap sequence $ rowParser indices `sepEndBy1` lineParser
1390 lines' <- fmap sequence $ rowParser indices `sepEndBy1` lineParser
@@ -2118,8 +2118,8 @@ doubleQuoted = try $ do
2118 fmap B.doubleQuoted . trimInlinesF . mconcat <$>
2118 fmap B.doubleQuoted . trimInlinesF . mconcat <$>
2119 many1Till inline doubleQuoteEnd
2119 many1Till inline doubleQuoteEnd
2120
2120
2121−toRow :: [Blocks] -> Pandoc.Row
2121+toRow :: [Blocks] -> Row
2122toRow = Row nullAttr . map B.simpleCell
2122toRow = Row nullAttr . map B.simpleCell
2123
2123
2124−toHeaderRow :: [Blocks] -> [Pandoc.Row]
2124+toHeaderRow :: [Blocks] -> [Row]
2125toHeaderRow l = if null l then [] else [toRow l]
2125toHeaderRow l = if null l then [] else [toRow l]