模块:GlitchText:修订间差异
来自Blockland Wiki
更多操作
创建页面,内容为“ local p = {} local glyphs = { "▓", "▒", "░", "█", "╳", "╱", "╲", "Ж", "Ψ", "※", "¤", "§", "ø", "þ", "æ", "µ", "∴", "∵", "⌁", "⌘", "⍉", "⟁", "⧖", "⨳", "⫷", "⫸", "0", "1", "7", "x", "_", "∿", "⌬", "⟊" } function p.main(frame) local text = frame.args.text or "" local i = 0 local output = mw.ustring.gsub( text, "[^\r\n]", function() i = i + 1…” |
无编辑摘要 |
||
| 第2行: | 第2行: | ||
local p = {} | local p = {} | ||
local | local function mask(text) | ||
return (mw.ustring.gsub(text, "[^%s]", "█")) | |||
end | |||
function p.main(frame) | function p.main(frame) | ||
local text = frame.args.text or "" | local text = frame.args.text or frame.args[1] or "" | ||
local | local span = mw.html.create("span") | ||
:addClass("krnk-glitch") | |||
" | :attr("data-text", text) | ||
:wikitext(mask(text)) | |||
return tostring(span) | |||
end | end | ||
return p | return p | ||
2026年10月22日 (四) 12:15的最新版本
此模块的文档可以在模块:GlitchText/doc创建
local p = {}
local function mask(text)
return (mw.ustring.gsub(text, "[^%s]", "█"))
end
function p.main(frame)
local text = frame.args.text or frame.args[1] or ""
local span = mw.html.create("span")
:addClass("krnk-glitch")
:attr("data-text", text)
:wikitext(mask(text))
return tostring(span)
end
return p