Module:StripFilename/doc

From "PTTLink Wiki"
< Module:StripFilename
Revision as of 15:31, 24 January 2022 by Kg7qin (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This is the documentation page for Module:StripFilename

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"