Not logged in
Talk
Contributions
Log in
Navigation
Main page
Recent changes
Random page
Upload file
Module
Discussion
Edit
View history
Editing
Module:Plain text
From Body Communication
Jump to:
navigation
,
search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
--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] return p._main(text) end function p._main(text) 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('<.->.-<.->', '') --strip out remaining tags and the text inside :gsub('<.->', '') --remove any other tag markup :gsub('%[%[%s*[Ff]ile%s*:.-%]%]', '') --strip out files :gsub('%[%[%s*[Ii]mage%s*:.-%]%]', '') --strip out use of image: :gsub('%[%[%s*[Cc]ategory%s*:.-%]%]', '') --strip out categories :gsub('%[%[[^%]]-|', '') --strip out piped link text :gsub('[%[%]]', '') --then strip out remaining [ and ] :gsub("'''''", "") --strip out bold italic markup :gsub("'''?", "") --not stripping out '''' gives correct output for bolded text in quotes :gsub('----', '') --remove ---- lines :gsub("^%s+", "") --strip leading :gsub("%s+$", "") --and trailing spaces :gsub("%s+", " ") --strip redundant spaces return text end return p
Summary:
Please note that all contributions to Body Communication are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (see
Body Communication:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Module:Plain text/doc
(
edit
)
Tools
What links here
Related changes
Special pages
Page information