git.iko.soy/typeable/pandoc
on master help sign in
MediaWiki reader: Parse styles on table cells.
commita2391b0395479e46ef6eaaea087c9f2ca7435ae2 authorJohn MacFarlane <jgm@berkeley.edu> dateSat 15 Sep 2012, 01:13 (14 years ago) parent9a54a94
1 file changed+6
src/Text/Pandoc/Readers/MediaWiki.hs+6
src/Text/Pandoc/Readers/MediaWiki.hs+6
@@ -30,6 +30,8 @@ Conversion of mediawiki text to 'Pandoc' document.
3030-}
3131{-
3232TODO:
33+_ tables - cell alignment and width
34+_ calculate cell widths when not given??? see html? latex? reader
3335_ support tables http://www.mediawiki.org/wiki/Help:Tables
3436- footnotes?
3537-}
@@ -225,6 +227,10 @@ tableCell :: MWParser Blocks
225227tableCell = try $ do
226228 cellsep
227229 skipMany spaceChar
230+ attrs <- (parseAttrs <$>
231+ manyTill (satisfy (/='\n'))
232+ (try $ char '|' <* notFollowedBy (char '|')))
233+ skipMany spaceChar
228234 ls <- many (notFollowedBy (cellsep <|> rowsep <|> tableEnd) *> anyChar)
229235 parseFromString (mconcat <$> many block) ls
230236