Module:ja-link/fast
Appearance
- The following documentation is located at Module:ja-link/fast/documentation. [edit]
- Useful links: root page • root page’s subpages • links • transclusions • testcases • sandbox
local export = {}
-- Used in [[Wiktionary:Frequency lists/Japanese]]. Converts bare links to
-- {{l/ja}}-type links.
function export.link(frame)
local text = frame.args[1]
if not text then
return nil
end
local function link(text)
return '<span class="Jpan" lang="ja">[['
.. text
.. '#Japanese|' .. text .. ']]</span>'
end
return (text
:gsub(
"%[%[([^%]]+)%]%]",
link))
end
return export