« Module:Personnagedujour » : différence entre les versions
Apparence
Aucun résumé des modifications |
Aucun résumé des modifications |
||
| Ligne 3 : | Ligne 3 : | ||
function p.depuis(frame) | function p.depuis(frame) | ||
local brut = frame.args["page"] or "" | local brut = frame.args["page"] or "" | ||
local titre = mw.text.trim(brut) | local titre = mw.text.trim(brut) | ||
local chars = {} | |||
for i = 1, mw.ustring.len(titre) do | |||
local c = mw.ustring.sub(titre, i, i) | |||
table.insert(chars, string.format("• %s (U+%04X)", c, mw.ustring.codepoint(c))) | |||
end | end | ||
return "Titre reçu : <code>" .. titre .. "</code><br/>" .. | |||
table.concat(chars, "<br/>") | |||
end | end | ||
return p | return p | ||
Version du 12 juillet 2025 à 18:51
La documentation pour ce module peut être créée à Module:Personnagedujour/doc
local p = {}
function p.depuis(frame)
local brut = frame.args["page"] or ""
local titre = mw.text.trim(brut)
local chars = {}
for i = 1, mw.ustring.len(titre) do
local c = mw.ustring.sub(titre, i, i)
table.insert(chars, string.format("• %s (U+%04X)", c, mw.ustring.codepoint(c)))
end
return "Titre reçu : <code>" .. titre .. "</code><br/>" ..
table.concat(chars, "<br/>")
end
return p