View source for Module:Plain text
Jump to navigation
Jump to search
You do not have permission to edit this page, for the following reason:
You can view and copy the source of this page.
--converts text with wikilinks to plain text, e.g "[[foo|gah]] is [[bar]]" to "gah is bar"
--removes anything enclosed in tags that isn't nested, mediawiki strip markers (references etc), files, italic and bold markup
local p = {}
function p.main(frame)
local text = frame.args[1]
local encode = require('Module:yesno')(frame.args.encode)
return p._main(text, encode)
end
function p._main(text, encode)
if not text then return end
text = mw.text.killMarkers(text)
:gsub(' ', ' ') --replace nbsp spaces with regular spaces
:gsub('<br ?/?>', ', ') --replace br with commas
:gsub('<span.->(.-)</span>', '%1') --remove spans while keeping text inside
:gsub('<i.->(.-)</i>', '%1') --remove italics while keeping text inside
:gsub('<b.->(.-)</b>', '%1') --remove bold while keeping text inside
:gsub('<em.->(.-)</em>', '%1') --remove emphasis while keeping text inside
:gsub('<strong.->(.-)</strong>', '%1') --remove strong while keeping text inside
000
1:0
Templates used on this page:
- Template:Category link with count (view source)
- Template:Clc (view source)
- Template:Documentation subpage (view source)
- Template:High-use (view source)
- Template:High use (view source)
- Template:Navbox (view source)
- Template:Navbox wikitext-handling templates (view source)
- Template:Plain text (view source)
- Template:Plain text/doc (view source)
- Template:Sandbox other (view source)
- Template:Template link (view source)
- Template:Tl (view source)
- Module:Arguments (view source)
- Module:High-use (view source)
- Module:Message box (view source)
- Module:Message box/configuration (view source)
- Module:Navbar (view source)
- Module:Navbar/configuration (view source)
- Module:Navbar/styles.css (view source)
- Module:Navbox (view source)
- Module:Navbox/configuration (view source)
- Module:Navbox/styles.css (view source)
- Module:No globals (view source)
- Module:Plain text (view source)
- Module:Plain text/doc (view source)
- Module:String (view source)
- Module:Transclusion count (view source)
- Module:Transclusion count/data/P (view source)
- Module:Yesno (view source)
Return to Module:Plain text.