Module:shortcut box: Difference between revisions

Jump to navigation Jump to search
ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
(Created page with "local export = {} local m_message_box = require("Module:Message box") local m_template = require("Module:template") function export.format_shortcuts(shortcuts) local text = {} for _, shortcut in ipairs(shortcuts) do if string.sub(shortcut, 9) == "Template:" then table.insert(text, m_template.make_template({string.sub(shortcut, 10)}, false)) else table.insert(shortcut) end end return table.concat(text, "\n") end function export.render_box(shortcuts) lo...")
 
No edit summary
Line 7: Line 7:
local text = {}
local text = {}
for _, shortcut in ipairs(shortcuts) do
for _, shortcut in ipairs(shortcuts) do
if string.sub(shortcut, 9) == "Template:" then
if string.sub(shortcut, 1, 9) == "Template:" then
table.insert(text, m_template.make_template({string.sub(shortcut, 10)}, false))
table.insert(text, m_template.make_template({[1] = string.sub(shortcut, 10)}, false))
else
else
table.insert(shortcut)
table.insert(text, shortcut)
end
end
end
end

Navigation menu