git.iko.soy/typeable/pandoc
on master help sign in
MediaWiki reader: Ignore attributes on headers.
commitca09c1ac3b66d5f019dfb7d52496f75f8e45d0f3 authorJohn MacFarlane <jgm@berkeley.edu> dateMon 20 May 2013, 11:08 (13 years ago) parentc63e490
1 file changed+3−4
src/Text/Pandoc/Readers/MediaWiki.hs+3−4
src/Text/Pandoc/Readers/MediaWiki.hs+3−4
@@ -229,7 +229,7 @@ tableEnd = try $ guardColumnOne *> skipSpaces *> sym "|}"
229229
230230rowsep :: MWParser ()
231231rowsep = try $ guardColumnOne *> skipSpaces *> sym "|-" <*
232− optional (void parseAttr) <* blanklines
232+ optional parseAttr <* blanklines
233233
234234cellsep :: MWParser ()
235235cellsep = try $
@@ -246,9 +246,8 @@ tableCaption = try $ do
246246 guardColumnOne
247247 skipSpaces
248248 sym "|+"
249− skipMany spaceChar
250− res <- anyLine >>= parseFromString (many inline)
251− return $ trimInlines $ mconcat res
249+ optional (try $ parseAttr *> skipSpaces *> char '|' *> skipSpaces)
250+ (trimInlines . mconcat) <$> many (notFollowedBy (cellsep <|> rowsep) *> inline)
252251
253252tableRow :: MWParser [((Alignment, Double), Blocks)]
254253tableRow = try $ many tableCell