편집 요약 없음
편집 요약 없음
218번째 줄: 218번째 줄:
<div style="font-size:80%%; color: gray; ">%s</div></td>
<div style="font-size:80%%; color: gray; ">%s</div></td>
<td class='unicodechar-next' style="width: 7em;font-size:1.2em;" lang="%s">%s</td>]], tr, lang, prevlink, lang, curr, p.code(curr), lang, nextlink)
<td class='unicodechar-next' style="width: 7em;font-size:1.2em;" lang="%s">%s</td>]], tr, lang, prevlink, lang, curr, p.code(curr), lang, nextlink)
end
return htmlroot:node(tr)
end
function p.unicodechar2(frame)
---@type table
local args = getArgs(frame)
local class
if args['class'] == 'x' then
class = ''
else
class = args['class'] or 'infobox'
end
local charname = args['이름'] or mw.title.getCurrentTitle().prefixedText
local curr = args[1] or args['기호'] or args['문자'] or nil
local eng = args['영어이름'] or p.unicodeBlock(curr)
local lang = args['lang'] or 'ko'
local prefix = args['경로'] or ''
    local buildlink = require('Module:linkwithtemplate').test
local function link(pagename, linktext, arrow, template, editintro)
        if template then
            return buildlink({
                [1] = pagename,
                [2] = string.format('<div>%s<br>%s</div>', linktext, arrow),
                ['템플릿'] = template,
                ['editintro'] = editintro,
            })
        else
            return ustring.format('[[%s|<div>%s<br>%s</div>]]', pagename, linktext, arrow or '')
        end
    end
local htmlroot = mw.html.create('table')
:addClass(class)
:addClass('unicodechar')
:cssText('margin: 0 auto ;max-width:  ;width: ;float: right; text-align: center; clear:right')
local tr, td
if args['이름'] == '없음' then
tr = ustring.format('<tr><th colspan="3"><small>%s</small></th></tr>',eng)
else
tr = ustring.format('<tr><th colspan="3"><div>%s</div><small>%s</small></th></tr>',charname, eng)
end
if curr == nil then
return '<span class="warning">기호 인수가 없습니다.</span>'
    else
        if curr:find("[Uu]") then
            curr = p.tochar(curr)
        end
end
if args['순서반전'] then
tr = ustring.format([[
<td class='unicodechar-char' style="width: 6em"><div style="font-size: 1.8em;line-height: 1.4em;"><b lang="%s">%s</b></div>
<div style="font-size:80%%; color: gray; ">%s</div></td>%s]], lang, curr, p.code(curr), tr)
else
tr = ustring.format([[%s
<td class='unicodechar-char' style="width: 6em"><div style="font-size: 1.8em;line-height: 1.4em;"><b lang="%s">%s</b></div>
<div style="font-size:80%%; color: gray; ">%s</div></td>]], tr, lang, curr, p.code(curr))
end
end
return htmlroot:node(tr)
return htmlroot:node(tr)