You can edit almost every page by Creating an account. Otherwise, see the FAQ.

Module:Wikitext

Uit EverybodyWiki Bios & Wiki
Ga naar:navigatie, zoeken
De sjabloonbeschrijving hieronder wordt niet afgebeeld wanneer het sjabloon wordt geplaatst.
bekijk documentatie

Doel

Doel van deze module is om een genummerde of ongenummerde lijst te ontdoen van de nummers/bolletjes. Bestemd voor Sjabloon:Ping project.

Gebruik

{{#invoke:Wikitext|delistify|
...
}}

Voorbeeld

{{#invoke:Wikitext|delistify|
* plop
wow
*# plop
*#plop}}

geeft:


plop wow plop plop

}}


z = {    
	-- mw = require "Module:mw"
};

function z.listifyLines(text)
    local result = ""
    for idx,line in ipairs(mw.text.split(text, "\n", true)) do
        if line ~= "" then
        	result = result .."* " .. line .. "\n"
        end
    end
    return result
end

function string.starts(String,Start)
   return string.sub(String,1,string.len(Start))==Start
end

function z.delistifyLines(text)
    local result = ""
    for idx,line in ipairs(mw.text.split(text, "\n", true)) do
        result = result .. line:gsub("^[*#]+ *", "") .. "\n"
    end
    return result
end

function z.listify(frame)
	return z.listifyLines(frame.args[1])
end

function z.delistify(frame)
	return z.delistifyLines(frame.args[1])
end

return z;

Dit Module "Wikitext" is uit Wikipedia. De lijst van zijn auteurs is te zien in zijn historische.