git.iko.soy/typeable/pandoc
on master help sign in
update syntax for Images/Media files in MediaWiki

The preferred syntax for Images and other media is [[File:Foo.jpg]] in MediaWiki since v1.14 (2008). [[Image:Foo.jpg]] is deprecated but still works as an alias to the File namespace. I don't think this would break any existing wikis since talk of switching the syntax/namespace for images started back in 2002 (https://phabricator.wikimedia.org/T2044). NS_FILE became the new namespace for Files in v 1.14 in late 2008. (https://www.mediawiki.org/wiki/Release_notes/1.14) There is still a namespace alias so '[[Image:]]' still works today. It's just that MediaWiki supports other media as well, and so the name and syntax used in documentation (see https://www.mediawiki.org/wiki/Help:Images) has long been '[[File:foo.jpg]]'

commit218f28af6d1d598386639725196d5d1d4c349738 authorGreg Rundlett <greg@freephile.com> dateThu 5 Feb 2015, 17:07 (12 years ago) parent13c4757
1 file changed+2−2
src/Text/Pandoc/Writers/MediaWiki.hs+2−2
src/Text/Pandoc/Writers/MediaWiki.hs+2−2
@@ -107,7 +107,7 @@ blockToMediaWiki (Para [Image txt (src,'f':'i':'g':':':tit)]) = do
107107 let opt = if null txt
108108 then ""
109109 else "|alt=" ++ if null tit then capt else tit ++ capt
110− return $ "[[Image:" ++ src ++ "|frame|none" ++ opt ++ "]]\n"
110+ return $ "[[File:" ++ src ++ "|frame|none" ++ opt ++ "]]\n"
111111
112112blockToMediaWiki (Para inlines) = do
113113 tags <- asks useTags
@@ -397,7 +397,7 @@ inlineToMediaWiki (Image alt (source, tit)) = do
397397 then ""
398398 else '|' : alt'
399399 else '|' : tit
400− return $ "[[Image:" ++ source ++ txt ++ "]]"
400+ return $ "[[File:" ++ source ++ txt ++ "]]"
401401
402402inlineToMediaWiki (Note contents) = do
403403 contents' <- blockListToMediaWiki contents