模组:沙盒/-Zest/test

来自Local Chinese Wikipedia
imported>-Zest2025年9月14日 (日) 09:08的版本 (解析階段被暫存,NG)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转到导航 跳转到搜索

此模块的文档可以在Module:沙盒/-Zest/test/doc创建

local p = {}

function p.count(frame)
    local category = frame.args[1]
    if not category then return "ERROR" end

    local wt = string.format(
        '<categorytree mode="pages" namespaces = "Main " >%s</categorytree>',
        category
    )

--??? 
-- for x in htmlstr:gmatch('<li>.-<a [^>]-href="[^"]+"[^>]->(.-)</a>') do
        -- x = mw.text.decodeHTML(linktext):match("^%s*(.-)%s*$")
        -- 
        --    
       -- end
    -- end

-- return maincount


--test
local html = frame:preprocess('<categorytree mode="pages" namespaces="Main">法国省份</categorytree>')
return mw.text.nowiki(tostring(html))

end

return p