aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Readers/MediaWiki.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Readers/MediaWiki.hs b/src/Text/Pandoc/Readers/MediaWiki.hs
index 2a3399a0c..7e8e606e5 100644
--- a/src/Text/Pandoc/Readers/MediaWiki.hs
+++ b/src/Text/Pandoc/Readers/MediaWiki.hs
@@ -34,7 +34,6 @@ _ support internal links http://www.mediawiki.org/wiki/Help:Links
_ support external links (partially implemented)
_ support images http://www.mediawiki.org/wiki/Help:Images
_ support tables http://www.mediawiki.org/wiki/Help:Tables
-_ gallery tag?
-}
module Text.Pandoc.Readers.MediaWiki ( readMediaWiki ) where
@@ -77,11 +76,12 @@ spaceChars = " \n\t"
sym :: String -> MWParser ()
sym s = () <$ try (string s)
+newBlockTags :: [String]
+newBlockTags = ["haskell","syntaxhighlight","gallery"]
+
isBlockTag' :: Tag String -> Bool
-isBlockTag' tag@(TagOpen t _) = isBlockTag tag ||
- t == "haskell" || t == "syntaxhighlight"
-isBlockTag' tag@(TagClose t) = isBlockTag tag ||
- t == "haskell" || t == "syntaxhighlight"
+isBlockTag' tag@(TagOpen t _) = isBlockTag tag || t `elem` newBlockTags
+isBlockTag' tag@(TagClose t) = isBlockTag tag || t `elem` newBlockTags
isBlockTag' tag = isBlockTag tag
htmlComment :: MWParser ()
@@ -149,6 +149,7 @@ blockTag = do
"syntaxhighlight" -> syntaxhighlight attrs
"haskell" -> B.codeBlockWith ("",["haskell"],[]) . trimCode <$>
charsInTags "haskell"
+ "gallery" -> blocksInTags "gallery"
"p" -> return mempty
_ -> return $ B.rawBlock "html" raw