Module:Documentation:修订间差异

删除的内容 添加的内容
修复3项: renderStartBoxLinks链接 / makeToolbar nil过滤 / EXPECTUNUSED分隔符
去掉 message() 中多余的 preprocess 调用(config 已无 -{}-)
 
(未显示同一用户的5个中间版本)
第20行:
--[[
-- Gets a message from the cfg table and formats it if appropriate.
-- SupportsConfig is plain -{zh-hans:...;, no zh-hant:...;{}- syntax viaprocessing frame:preprocess()needed.
--]]
local msg = cfg[cfgKey]
第93行:
 
p.makeToolbar = makeToolbar
 
local function escapeBrackets(s)
-- 将方括号转为 HTML 实体,防止被 wikitext 解析为外部链接
s = s:gsub('%[', '[')
s = s:gsub('%]', ']')
return s
end
 
p.escapeBrackets = escapeBrackets
 
----------------------------------------------------------------------------
第354行 ⟶ 第345行:
omargs.image = message('sandbox-notice-image')
 
local text = '__EXPECTUNUSEDTEMPLATE__\\n'
local pagetype, pagetypee, sandboxCat
if subjectSpace == 10 then
第462行 ⟶ 第453行:
 
function p.renderStartBoxLinks(data)
-- 纯 wikilink 拼接,由 MediaWiki 内核自动渲染方括号外观
local docTitle = data.docTitle
local purgeLink = makeWikilink("Special:Purge/" .. data.title.prefixedText, data.purgeLinkDisplay)
第469行 ⟶ 第459行:
local editLink = makeWikilink("Special:EditPage/" .. docTitle.prefixedText, data.editLinkDisplay)
local historyLink = makeWikilink("Special:PageHistory/" .. docTitle.prefixedText, data.historyLinkDisplay)
return format('[%s] [%s] [%s] [%s]',
return viewLink .., editLink .., historyLink .., purgeLink)
else
local createLink = makeUrlLink(docTitle:canonicalUrl{action = 'edit', preload = data.preload}, data.createLinkDisplay)
return createLinkformat('[%s] ..[%s]', createLink, purgeLink)
end
end
第508行 ⟶ 第499行:
if links then
data.linksClass = message('start-box-link-classes')
data.linksId = message('start-box-link-id')
data.links = links
end