문서 편집 권한이 없습니다. 다음 이유를 확인해주세요: 요청한 명령은 다음 중 하나의 권한을 가진 사용자에게 제한됩니다: 사용자, 관리자. 이 문서는 편집하거나 다른 명령을 할 수 없도록 보호되어 있습니다. 문서를 고치려면 이메일 인증 절차가 필요합니다. 사용자 환경 설정에서 이메일 주소를 입력하고 이메일 주소 인증을 해주시기 바랍니다. 문서의 원본을 보거나 복사할 수 있습니다. local p = {} function escape_html(text) return text :gsub("&", "&") :gsub("<", "<") :gsub(">", ">") :gsub("\"", """) :gsub("'", "'") end function p.main(frame) local args = frame:getParent().args local light = args[1] or '' local dark = args[2] or '' local width = escape_html(args[3] or '') local alt = escape_html(args['alt'] or '') local link = escape_html(args['link'] or '') local class = escape_html(args['class'] or '') local style = escape_html(args['style'] or '') if light == '' then return '<strong class="error">라이트모드 이미지가 필요합니다.</strong>' end local lighturl = escape_html(frame:callParserFunction('filepath', light)) local darkurl = '' if dark and mw.text.trim(dark) ~= '' then darkurl = escape_html(frame:callParserFunction('filepath', dark)) end local html = {} table.insert(html, '<div class="image-switch-wrapper">') -- 라이트모드 이미지 local img1 = '<img src="' .. lighturl .. '" class="light-mode-img' if class ~= '' then img1 = img1 .. ' ' .. class end img1 = img1 .. '"' if width ~= '' then img1 = img1 .. ' width="' .. width .. '"' end if alt ~= '' then img1 = img1 .. ' alt="' .. alt .. '"' end if style ~= '' then img1 = img1 .. ' style="' .. style .. '"' end img1 = img1 .. '>' -- 다크모드 이미지 local img2 = '' if darkurl ~= '' then img2 = '<img src="' .. darkurl .. '" class="dark-mode-img' if class ~= '' then img2 = img2 .. ' ' .. class end img2 = img2 .. '"' if width ~= '' then img2 = img2 .. ' width="' .. width .. '"' end if alt ~= '' then img2 = img2 .. ' alt="' .. alt .. '"' end if style ~= '' then img2 = img2 .. ' style="' .. style .. '"' end img2 = img2 .. '>' end if link ~= '' then table.insert(html, '<a href="/wiki/' .. link .. '">' .. img1 .. img2 .. '</a>') else table.insert(html, img1 .. img2) end table.insert(html, '</div>') return table.concat(html) end return p 이 문서에서 사용한 틀: 모듈:ImageSwitch/설명문서 (원본 보기) 모듈:ImageSwitch 문서로 돌아갑니다.