Content deleted Content added
mNo edit summary |
Paisley Park (talk | contribs) No edit summary |
||
(13 intermediate revisions by one other user not shown) | |||
Line 20:
-- Helper function to determine the style based on the type argument
local function switchType(type, hover, hovertext)
local
local dataContentType = ""
if type == "J" then
elseif type == "R" then
else
-- Determine `data-content-type` based on conditions
if type ~= "J" and type ~= "R" then
if args[3] and args[3] ~= "" then
dataContentType = ' data-content-type="nihongo-romaji"'
elseif args[2] and args[2] ~= "" then
dataContentType = ' data-content-type="nihongo-japanese"'
end
elseif type == "J" and args[2] and args[2] ~= "" then
dataContentType = ' data-content-type="nihongo-romaji"'
end
end
return
end
-- Determine the styles for each type
local type1Style = switchType(args.type1 or 'E', args.hover and not (args[3] and args[3] ~= ''), args[2] or '')
local type2Style = switchType(args.type2 or 'J', args.hover and args[3], args[3] or '')
local type3Style = switchType(args.type3 or 'R', args.hover, args[4] or '')
Line 64 ⟶ 75:
end
if args[2] and args[2] ~= '' and not (args.hover and not (args[3] and args[3] ~= '')) then
-- Add line break if requested
if args.lineBreak and args.lineBreak ~= '' then
Line 79 ⟶ 90:
end
else
result = result .. ' '
end
end
|