Jump to content
Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Revision as of 06:00, 18 October 2026 by Maintenance script (talk | contribs) (Redesign: Star Citizen Wiki style Main Page, infoboxes and notices; short descriptions; Create a page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Turns wikitext into plain text, removing link markup, bold and italic marks, and HTML tags. Used by the infoboxes to build automatic short descriptions, so a homeworld written as [[Halcyon#Nereid|Nereid]] becomes just "Nereid".

{{#invoke:Plain|text|some [[linked]] text}} gives "some linked text".


-- Turns wikitext into plain text: [[Page|label]] -> label, [[Page]] -> Page,
-- and removes bold/italic marks and HTML tags.
-- Used by the infoboxes to build automatic short descriptions.
-- Usage: {{#invoke:Plain|text|some [[linked]] text}}
local p = {}

function p.text( frame )
	local s = frame.args[ 1 ] or ''
	s = s:gsub( '%[%[[^%]|]*|([^%]]*)%]%]', '%1' )
	s = s:gsub( '%[%[([^%]]*)%]%]', '%1' )
	s = s:gsub( "'''?", '' )
	s = s:gsub( '<[^>]->', '' )
	return mw.text.trim( s )
end

return p