Difference between revisions of "Module:StripFilename/doc"
Jump to navigation
Jump to search
Mediawiki>Sarang m (→Examples) |
m (1 revision imported) |
Latest revision as of 15:31, 24 January 2022
This Lua module removes the "File:" or "Image:" namespace prefix and any valid file extension from a given filename (both case-insensitive).
Examples
Input | Output | Notes |
---|---|---|
{{#invoke:StripFilename|main|File:Example.svg}}
|
Example | |
{{#invoke:StripFilename|main|Image:Example.mid}}
|
Example | |
{{#invoke:StripFilename|main|Example.JPG}}
|
Example | Uppercase extension |
{{#invoke:StripFilename|main|Example.foo}}
|
Example.foo | Unknown extension |
{{#invoke:StripFilename|main|fiLE:Example.svg}}
|
Example | Mixed-case namespace (works in MediaWiki) |
{{#invoke:StripFilename|svg|Example.pdf}}
|
Example.svg | keep, replace or add ".svg" |