aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2012-09-13 14:55:33 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2012-09-13 14:55:33 -0700
commit5b29f0f5983e03607712faf36d296b7b06cd1e61 (patch)
tree6437073fbf1015daf450eda44ad75555a4d0b282 /src/Text
parent81bec8558ca5583886443722092e12540c0ceb49 (diff)
downloadpandoc-5b29f0f5983e03607712faf36d296b7b06cd1e61.tar.gz
MediaWiki reader: Ignore `<gallery>` tags.
Diffstat (limited to 'src/Text')
-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