aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/MediaWiki.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Readers/MediaWiki.hs')
-rw-r--r--src/Text/Pandoc/Readers/MediaWiki.hs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/MediaWiki.hs b/src/Text/Pandoc/Readers/MediaWiki.hs
index f6192ffc6..38ffed835 100644
--- a/src/Text/Pandoc/Readers/MediaWiki.hs
+++ b/src/Text/Pandoc/Readers/MediaWiki.hs
@@ -89,7 +89,7 @@ nested p = do
return res
specialChars :: [Char]
-specialChars = "'[]<=&*{}|"
+specialChars = "'[]<=&*{}|\""
spaceChars :: [Char]
spaceChars = " \n\t"
@@ -445,6 +445,7 @@ inline :: MWParser Inlines
inline = whitespace
<|> url
<|> str
+ <|> doubleQuotes
<|> strong
<|> emph
<|> image
@@ -540,7 +541,7 @@ internalLink = try $ do
-- [[Help:Contents|] -> "Contents"
<|> (return $ B.text $ drop 1 $ dropWhile (/=':') pagename) )
sym "]]"
- linktrail <- B.text <$> many (char '\'' <|> letter)
+ linktrail <- B.text <$> many letter
let link = B.link (addUnderscores pagename) "wikilink" (label <> linktrail)
if "Category:" `isPrefixOf` pagename
then do
@@ -582,3 +583,10 @@ strong = B.strong <$> nested (inlinesBetween start end)
where start = sym "'''" >> lookAhead nonspaceChar
end = try $ sym "'''"
+doubleQuotes :: MWParser Inlines
+doubleQuotes = B.doubleQuoted . trimInlines . mconcat <$> try
+ ((getState >>= guard . readerSmart . mwOptions) *>
+ openDoubleQuote *> manyTill inline closeDoubleQuote )
+ where openDoubleQuote = char '"' <* lookAhead alphaNum
+ closeDoubleQuote = char '"' <* notFollowedBy alphaNum
+