Module:StripFilename/doc

From "PTTLink Wiki"
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"