打开/关闭搜索
搜索
打开/关闭菜单
331
1.7K
131
11.8K
星露谷物语扩展百科
导航
首页
最近更改
随机页面
交流群
互通站
上传文件
打开/关闭外观设置菜单
通知
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。
user-interface-preferences
个人工具
创建账号
登录
查看“︁模块:Quote”︁的源代码
来自星露谷物语扩展百科
查看
阅读
查看源代码
查看历史
associated-pages
模块
讨论
更多操作
←
模块:Quote
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:已验证邮箱用户
您必须确认您的电子邮件地址才能编辑页面。请通过
参数设置
设置并确认您的电子邮件地址。
您可以查看和复制此页面的源代码。
local p = {} -- 检查文本中是否有且仅有一个中文冒号":",且冒号前面没有出现过中文逗号和中文句号 function p.split(frame) local text = frame.args[1] or "" -- 计算中文冒号的数量 local colonCount = 0 for _ in mw.ustring.gmatch(text, ":") do colonCount = colonCount + 1 end -- 如果不是只有一个冒号,返回空 if colonCount ~= 1 then return "" end -- 找到冒号的位置 local colonPos = mw.ustring.find(text, ":") -- 检查冒号前面是否有中文逗号或中文句号 local beforeColon = mw.ustring.sub(text, 1, colonPos - 1) if mw.ustring.find(beforeColon, "[,。]") then return "" end -- 分割文本 local afterColon = mw.ustring.sub(text, colonPos + 1) -- 返回结果 if frame.args.part == "before" then return beforeColon elseif frame.args.part == "after" then return afterColon else -- 默认返回两部分,用 frame.args.separator 分隔(默认为制表符) local separator = frame.args.separator or "\t" return beforeColon .. separator .. afterColon end end return p
该页面嵌入的页面:
模块:Documentation
(
查看源代码
)
模块:Documentation/styles.css
(
查看源代码
)
模块:ProcessArgs
(
查看源代码
)
模块:Quote/doc
(
查看源代码
)
模块:STConversion
(
查看源代码
)
模块:Static
(
查看源代码
)
模块:TSLoader
(
查看源代码
)
返回
模块:Quote
。
查看“︁模块:Quote”︁的源代码
来自星露谷物语扩展百科