aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2012-09-15 01:13:26 -0400
committerJohn MacFarlane <jgm@berkeley.edu>2012-09-15 01:13:26 -0400
commita2391b0395479e46ef6eaaea087c9f2ca7435ae2 (patch)
treea2fa1576f1f3fb8e14dd179d666e3e164f3547b2
parent9a54a949c7a527d87958c2fc00d4712f7adb5d1e (diff)
downloadpandoc-a2391b0395479e46ef6eaaea087c9f2ca7435ae2.tar.gz
MediaWiki reader: Parse styles on table cells.
-rw-r--r--src/Text/Pandoc/Readers/MediaWiki.hs6
1 files changed, 6 insertions, 0 deletions
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