Module:links/templates: Difference between revisions
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
-- Prevent substitution. | |||
if mw.isSubsting() then | |||
return require("Module:unsubst") | |||
end | |||
local export = {} | |||
local process_params = require("Module:parameters").process | local process_params = require("Module:parameters").process | ||
local remove = table.remove | local remove = table.remove | ||
local upper = require("Module:string utilities").upper | local upper = require("Module:string utilities").upper | ||
--[=[ | --[=[ | ||
| Line 62: | Line 67: | ||
local compat = iargs.compat | local compat = iargs.compat | ||
local lang = args[compat and "lang" or 1] | local lang = args[compat and "lang" or 1] | ||
local term = args[(compat and 1 or 2)] | local term = args[(compat and 1 or 2)] | ||
| Line 147: | Line 151: | ||
[1] = {required = true, default = ""}, | [1] = {required = true, default = ""}, | ||
}) | }) | ||
local | local face = frame.args.face | ||
local | |||
local ret = require("Module:script utilities").tag_definition(require("Module:links").embedded_language_links{ | |||
term = args[1], | term = args[1], | ||
lang = | lang = require("Module:languages").getByCode("en"), | ||
sc = | sc = require("Module:scripts").getByCode("Latn") | ||
}, | }, face) | ||
if face == "non-gloss" then | |||
return ret | |||
end | |||
return '<span class="mention-gloss-paren">(</span>' .. ret .. '<span class="mention-gloss-paren">)</span>' | |||
end | end | ||
| Line 168: | Line 176: | ||
if args[1] == "" or args[1]:find("[[", nil, true) then | if args[1] == "" or args[1]:find("[[", nil, true) then | ||
return args[1] | return args[1] | ||
end | end | ||
return "[[" .. args[1] .. "]]" | |||
end | end | ||