跳转到内容

模組:Template test case/data

维基百科,自由的百科全书

这是Module:Template test case/data当前版本,由Vozhuo留言 | 贡献编辑于2017年7月7日 (五) 02:35 建立内容为“-- This module processes configuration data for use in -- Module:Template test case. It is loaded from the main module with -- mw.loadData. loc…”的新页面)。这个网址是本页该版本的固定链接。

(差异) ←上一修订 | 最后版本 (差异) | 下一修订→ (差异)
文档图示 模块文档[创建]
-- This module processes configuration data for use in
-- [[Module:Template test case]]. It is loaded from the main module with
-- mw.loadData.

local cfg = require('Module:Template test case/config')

local function escapePattern(s)
	s = s:gsub('%p', '%%%0')
	return s
end

-- Escape config items that need to be used as patterns. Doing it here is more
-- efficient, as mw.loadData saves them from having to be computed for every
-- test case on a page.
cfg.templateNameMagicWordPattern = escapePattern(cfg.templateNameMagicWord)
cfg.sandboxSubpagePattern = '/' .. escapePattern(cfg.sandboxSubpage) .. '$'

return cfg