跳转到内容
开关侧边栏
希服维基
搜索
创建账号
个人工具
创建账号
登录
未登录编辑者的页面
了解详情
讨论
贡献
导航
首页
最近更改
随机页面
沙盒
在线地图
官方网站
希顶相关网站
希顶维基
虫站
〇改希顶转写器
工具
链入页面
相关更改
特殊页面
页面信息
编辑“
模块:层级表
”
模块
讨论
English
阅读
编辑
查看历史
更多
阅读
编辑
查看历史
DGCK81LNN
(
讨论
|
贡献
)
2025年3月19日 (三) 23:30的版本
(debug)
(
差异
)
←上一版本
|
最后版本
(
差异
) |
下一版本→
(
差异
)
警告:您正在编辑的是本页面的旧版本。
如果您发布该更改,该版本后的所有更改都会丢失。
警告:
您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您
登录
或
创建
一个账户,您的编辑将归属于您的用户名,且将享受其他好处。
反垃圾检查。
不要
加入这个!
local getArgs = require('Module:Arguments').getArgs local p = {} function p._main(args) local s = "{|" if args.class then s=s.. 'class="' .. mw.text.nowiki(args.class) .. '"' end local cells = {} local row = 1 local last_col = 0 local max_col = 1 s=s.. "\n|+DEBUG: args[1] = " .. mw.text.nowiki(args[1]) for i = 1, table.maxn(args) do local arg = args[i] if arg and arg ~= "" then if arg:sub(1, 1) == "+" then s=s.. "\n|" .. arg elseif arg:sub(1, 1) == "!" then s=s.. "\n" .. arg else local stars, text = arg:match("(%**)(.+)") local col = #stars + 1 if col > max_col then max_col = col elseif col <= last_col then row = row + 1 end table.insert(cells, { row=row, col=col, text=text }) last_col = col end end end local max_row = row for i, cell in ipairs(cells) do local row = cell.row local col = cell.col local row2 = max_row local col2 = max_col if i < #cells and cells[i + 1].row == row then col2 = cells[i + 1].col - 1 end for j = i + 1, #cells do if cells[j].row > row and cells[j].col <= col2 then row2 = cells[j].row - 1 break end end local rowspan = row2 - row + 1 local colspan = col2 - col + 1 s=s.. "\n|" if rowspan ~= 1 then s=s.. " rowspan=" .. rowspan end if colspan ~= 1 then s=s.. " colspan=" .. colspan end s=s.. "|" .. cell.text end s=s.. "\n|}" return s end function p.main(frame) local args = getArgs(frame, { wrappers={ "模板:层级表" } }) return p._main(args) end return p
摘要:
请注意,您对希服维基的所有贡献都可能被其他贡献者编辑,修改或删除。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源(参阅
希服维基:版权
的细节)。
未经许可,请勿提交受版权保护的作品!
取消
编辑帮助
(在新窗口中打开)
本页使用的模板:
模块:层级表/doc
(
编辑
)