MediaWiki writer: transform filename with underscores in images.
`foo bar.jpg` becomes `foo_bar.jpg`. This was already done
for internal links, but it also needs to happen for images.
Closes #3052.
commit1435906f097fa8d5ad08728c3b95cd2992678230
authorJohn MacFarlane <jgm@berkeley.edu>
dateSun 2 Oct 2016, 22:09 (10 years ago)
parentd0bfcbb
src/Text/Pandoc/Readers/MediaWiki.hs+1−1
@@ -585,7 +585,7 @@ image :: MWParser Inlines
585585image = try $ do
586586 sym "[["
587587 choice imageIdentifiers
588− fname <- many1 (noneOf "|]")
588+ fname <- addUnderscores <$> many1 (noneOf "|]")
589589 _ <- many imageOption
590590 dims <- try (char '|' *> (sepBy (many digit) (char 'x')) <* string "px")
591591 <|> return []