(创建页面,内容为“local p = {} function p.print_text(frame) local args = frame.args local text = args[1] local ISBN = {} ISBN[#ISBN+1] = mw.ustring.sub(text, 1, 3) ISBN[#ISBN+1] = '-' ISBN[#ISBN+1] = mw.ustring.sub(text, 4, 4) ISBN[#ISBN+1] = '-' ISBN[#ISBN+1] = mw.ustring.sub(text, 5, 8) ISBN[#ISBN+1] = '-' ISBN[#ISBN+1] = mw.ustring.sub(text, 9, 12) ISBN[#ISBN+1] = '-' ISBN[#ISBN+1] = mw.ustring.sub(text, 13) return table…”) |
小 (// Edit via Wikiplus) |
||
(未显示同一用户的2个中间版本) | |||
第1行: | 第1行: | ||
local p = {} |
local p = {} |
||
function p. |
function p.main(frame) |
||
local args = frame.args |
local args = frame.args |
||
local text = args[1] |
local text = args[1] |
||
⚫ | |||
return text |
|||
end |
|||
local ISBN = {} |
local ISBN = {} |
||
⚫ | |||
ISBN[#ISBN+1] = ' |
ISBN[#ISBN + 1] = 'ISBN ' |
||
ISBN[#ISBN+1] = mw.ustring.sub(text, |
ISBN[#ISBN + 1] = mw.ustring.sub(text, 1, 3) |
||
ISBN[#ISBN+1] = '-' |
ISBN[#ISBN + 1] = '-' |
||
ISBN[#ISBN+1] = mw.ustring.sub(text, |
ISBN[#ISBN + 1] = mw.ustring.sub(text, 4, 4) |
||
ISBN[#ISBN+1] = '-' |
ISBN[#ISBN + 1] = '-' |
||
ISBN[#ISBN+1] = mw.ustring.sub(text, |
ISBN[#ISBN + 1] = mw.ustring.sub(text, 5, 8) |
||
ISBN[#ISBN+1] = '-' |
ISBN[#ISBN + 1] = '-' |
||
ISBN[#ISBN+1] = mw.ustring.sub(text, |
ISBN[#ISBN + 1] = mw.ustring.sub(text, 9, 12) |
||
ISBN[#ISBN + 1] = '-' |
|||
ISBN[#ISBN + 1] = mw.ustring.sub(text, 13) |
|||
return table.concat(ISBN) |
return table.concat(ISBN) |
2023年8月23日 (三) 16:34的最新版本
local p = {}
function p.main(frame)
local args = frame.args
local text = args[1]
if mw.ustring.sub(text, 1, 4) == 'ISBN' then
return text
end
local ISBN = {}
ISBN[#ISBN + 1] = 'ISBN '
ISBN[#ISBN + 1] = mw.ustring.sub(text, 1, 3)
ISBN[#ISBN + 1] = '-'
ISBN[#ISBN + 1] = mw.ustring.sub(text, 4, 4)
ISBN[#ISBN + 1] = '-'
ISBN[#ISBN + 1] = mw.ustring.sub(text, 5, 8)
ISBN[#ISBN + 1] = '-'
ISBN[#ISBN + 1] = mw.ustring.sub(text, 9, 12)
ISBN[#ISBN + 1] = '-'
ISBN[#ISBN + 1] = mw.ustring.sub(text, 13)
return table.concat(ISBN)
end
return p