bugfix0531
全站通知:

模块:StripHtml

来自梦幻模拟战WIKI_BWIKI_哔哩哔哩
跳到导航 跳到搜索

此模块的文档可以在模块:StripHtml/doc创建

local p = {}

function p.stripHtml(frame)
    local text = frame.args[1] or ''
    -- 移除 HTML 标签
    text = text:gsub('<[^>]+>', '')
    -- 解码 HTML 实体(如 &nbsp;)
    text = mw.text.decode(text)
    return text
end

return p