git.iko.soy/typeable/pandoc
on master help sign in
MediaWiki reader: Parse styles on table cells.
a2391b0John MacFarlane
src/Text/Pandoc/Readers/MediaWiki.hs+6
@@ -30,6 +30,8 @@ Conversion of mediawiki text to 'Pandoc' document.
30-}
30-}
31{-
31{-
32TODO:
32TODO:
33+_ tables - cell alignment and width
34+_ calculate cell widths when not given??? see html? latex? reader
33_ support tables http://www.mediawiki.org/wiki/Help:Tables
35_ support tables http://www.mediawiki.org/wiki/Help:Tables
34- footnotes?
36- footnotes?
35-}
37-}
@@ -225,6 +227,10 @@ tableCell :: MWParser Blocks
225tableCell = try $ do
227tableCell = try $ do
226 cellsep
228 cellsep
227 skipMany spaceChar
229 skipMany spaceChar
230+ attrs <- (parseAttrs <$>
231+ manyTill (satisfy (/='\n'))
232+ (try $ char '|' <* notFollowedBy (char '|')))
233+ skipMany spaceChar
228 ls <- many (notFollowedBy (cellsep <|> rowsep <|> tableEnd) *> anyChar)
234 ls <- many (notFollowedBy (cellsep <|> rowsep <|> tableEnd) *> anyChar)
229 parseFromString (mconcat <$> many block) ls
235 parseFromString (mconcat <$> many block) ls
230
236