편집 요약 없음 |
편집 요약 없음 |
||
1번째 줄: | 1번째 줄: | ||
local p | -- Module:Dictionary ▼전체 교체 | ||
local p = {} | |||
local encode = mw.text.encode | local encode = mw.text.encode | ||
local data | local data = mw.loadData('Module:Dictionary/data') | ||
function p.render(frame) | function p.render(frame) | ||
local out = { | -- ① 검색 UI가 들어갈 빈 컨테이너 | ||
local out = { '<div class="dictionary-container"></div>' } | |||
-- | -- ② 숨겨 둔 JSON (XSS 방지 HTML-escape) | ||
out[#out+1] = '<div id="dictionary-json" style="display:none">' | out[#out+1] = '<div id="dictionary-json" style="display:none">' | ||
.. encode( | .. encode(mw.text.jsonEncode(data)) | ||
.. '</div>' | |||
return table.concat(out, '\n') | return table.concat(out, '\n') | ||
end | end | ||
return p | return p |
2025년 6월 29일 (일) 03:15 판
이 모듈에 대한 설명문서는 모듈:Dictionary/설명문서에서 만들 수 있습니다
-- Module:Dictionary ▼전체 교체
local p = {}
local encode = mw.text.encode
local data = mw.loadData('Module:Dictionary/data')
function p.render(frame)
-- ① 검색 UI가 들어갈 빈 컨테이너
local out = { '<div class="dictionary-container"></div>' }
-- ② 숨겨 둔 JSON (XSS 방지 HTML-escape)
out[#out+1] = '<div id="dictionary-json" style="display:none">'
.. encode(mw.text.jsonEncode(data))
.. '</div>'
return table.concat(out, '\n')
end
return p