打开/关闭搜索
搜索
打开/关闭菜单
1
1
1
239
Tiancheng Wiki
导航
首页
最近更改
随机页面
MediaWiki帮助
特殊页面
上传文件
打开/关闭外观设置菜单
notifications
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。
user-interface-preferences
中文(中国大陆)
个人工具
创建账号
登录
查看“︁模块:If in page”︁的源代码
来自Tiancheng Wiki
查看
阅读
查看源代码
查看历史
associated-pages
模块
讨论
更多操作
←
模块:If in page
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
local p = {} local getArgs = require('Module:Arguments').getArgs function p.match(args) if not args["page"] then args.page = mw.title.getCurrentTitle().fullText end local page = mw.title.new(args.page) if not page then return args["3"] or "" end local content = page:getContent() if not content then return args["3"] or "" end if mw.ustring.match(content, args["1"] or "") then if args["subst"] then local pattern = args["1"] or "" if mw.ustring.sub(pattern, 1, 1) ~= "^" then pattern = "^.-" .. pattern end if mw.ustring.sub(pattern, -1) ~= "$" then pattern = pattern .. ".*$" end local out = mw.ustring.gsub(content, pattern, args["2"] or "") return out else return args["2"] or "" end else return args["3"] or "" end end function p.main(frame) local args = getArgs(frame) return p.match(args) end return p
返回
模块:If in page
。
查看“︁模块:If in page”︁的源代码
来自Tiancheng Wiki