Documentation for this module may be created at Module:Ruby2/doc

local export = {}

    local args = frame:getParent().args
	local word = args[1]
	local lang = args['lang'] or 'ja'
	local replace = '<ruby class="rubytext ruby-'..lang..'" lang="'..lang..'"><rb>%1</rb><rp>(</rp><rt>%2</rt><rp>)</rp></ruby>'
	word = mw.ustring.gsub(word, "%[([^%[%]]+)%]%(([^%(%)]+)%)", replace)
	return word

return export
*Disclosure: Some of the links above are affiliate links, meaning, at no additional cost to you, Fandom will earn a commission if you click through and make a purchase. Community content is available under CC-BY-SA unless otherwise noted.