From a2391b0395479e46ef6eaaea087c9f2ca7435ae2 Mon Sep 17 00:00:00 2001
From: John MacFarlane <jgm@berkeley.edu>
Date: Sat, 15 Sep 2012 01:13:26 -0400
Subject: [PATCH] MediaWiki reader: Parse styles on table cells.

---
 src/Text/Pandoc/Readers/MediaWiki.hs | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/Text/Pandoc/Readers/MediaWiki.hs b/src/Text/Pandoc/Readers/MediaWiki.hs
index 89564f504..e8952f9af 100644
--- a/src/Text/Pandoc/Readers/MediaWiki.hs
+++ b/src/Text/Pandoc/Readers/MediaWiki.hs
@@ -30,6 +30,8 @@ Conversion of mediawiki text to 'Pandoc' document.
 -}
 {-
 TODO:
+_ tables - cell alignment and width
+_ calculate cell widths when not given???  see html? latex? reader
 _ support tables http://www.mediawiki.org/wiki/Help:Tables
 - footnotes?
 -}
@@ -225,6 +227,10 @@ tableCell :: MWParser Blocks
 tableCell = try $ do
   cellsep
   skipMany spaceChar
+  attrs <- (parseAttrs <$>
+                  manyTill (satisfy (/='\n'))
+                    (try $ char '|' <* notFollowedBy (char '|')))
+  skipMany spaceChar
   ls <- many (notFollowedBy (cellsep <|> rowsep <|> tableEnd) *> anyChar)
   parseFromString (mconcat <$> many block) ls