@@ -34,7 +34,6 @@ _ support internal links http://www.mediawiki.org/wiki/Help:Links
34_ support external links (partially implemented)
34_ support external links (partially implemented)
35_ support images http://www.mediawiki.org/wiki/Help:Images
35_ support images http://www.mediawiki.org/wiki/Help:Images
36_ support tables http://www.mediawiki.org/wiki/Help:Tables
36_ support tables http://www.mediawiki.org/wiki/Help:Tables
39module Text.Pandoc.Readers.MediaWiki ( readMediaWiki ) where
38module Text.Pandoc.Readers.MediaWiki ( readMediaWiki ) where
@@ -77,11 +76,12 @@ spaceChars = " \n\t"
77sym :: String -> MWParser ()
76sym :: String -> MWParser ()
78sym s = () <$ try (string s)
77sym s = () <$ try (string s)
79+newBlockTags :: [String]
80+newBlockTags = ["haskell","syntaxhighlight","gallery"]
80isBlockTag' :: Tag String -> Bool
82isBlockTag' :: Tag String -> Bool
81−isBlockTag' tag@(TagOpen t _) = isBlockTag tag ||
83+isBlockTag' tag@(TagOpen t _) = isBlockTag tag || t `elem` newBlockTags
82− t == "haskell" || t == "syntaxhighlight"
83−isBlockTag' tag@(TagClose t) = isBlockTag tag ||
84+isBlockTag' tag@(TagClose t) = isBlockTag tag || t `elem` newBlockTags
84− t == "haskell" || t == "syntaxhighlight"
85isBlockTag' tag = isBlockTag tag
85isBlockTag' tag = isBlockTag tag
87htmlComment :: MWParser ()
87htmlComment :: MWParser ()
@@ -149,6 +149,7 @@ blockTag = do
149 "syntaxhighlight" -> syntaxhighlight attrs
149 "syntaxhighlight" -> syntaxhighlight attrs
150 "haskell" -> B.codeBlockWith ("",["haskell"],[]) . trimCode <$>
150 "haskell" -> B.codeBlockWith ("",["haskell"],[]) . trimCode <$>
151 charsInTags "haskell"
151 charsInTags "haskell"
152+ "gallery" -> blocksInTags "gallery"
152 "p" -> return mempty
153 "p" -> return mempty
153 _ -> return $ B.rawBlock "html" raw
154 _ -> return $ B.rawBlock "html" raw