aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-11-24 12:51:41 +0100
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-11-24 15:28:57 +0100
commit303e42a94f16e00ecb65fb9de2d282d050a626c1 (patch)
tree9bc7dd7449b0250c8ca5f274c3f04b5a37b1bd0d /src/Text
parente1a9a61774cce807c6db2fff7b8609b2d9dbc678 (diff)
downloadpandoc-303e42a94f16e00ecb65fb9de2d282d050a626c1.tar.gz
MediaWiki reader: Accept image links in more languages
In some of the Wikipedia versions the local version of 'File' is used (for example 'Archivo' in Spanish)
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/MediaWiki.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/MediaWiki.hs b/src/Text/Pandoc/Readers/MediaWiki.hs
index 1c074e3de..7f99af528 100644
--- a/src/Text/Pandoc/Readers/MediaWiki.hs
+++ b/src/Text/Pandoc/Readers/MediaWiki.hs
@@ -549,10 +549,14 @@ endline = () <$ try (newline <*
notFollowedBy' header <*
notFollowedBy anyListStart)
+imageIdentifiers :: [MWParser ()]
+imageIdentifiers = [sym (identifier ++ ":") | identifier <- identifiers]
+ where identifiers = ["File", "Image", "Archivo", "Datei", "Fichier"]
+
image :: MWParser Inlines
image = try $ do
sym "[["
- sym "File:" <|> sym "Image:"
+ choice imageIdentifiers
fname <- many1 (noneOf "|]")
_ <- many (try $ char '|' *> imageOption)
caption <- (B.str fname <$ sym "]]")