模組:沙盒/SunAfterRain/NavFrameUtil

local p = {}

local mCrc32 = require('Module:Crc32lua')

local function makeHash()
	return mCrc32.crc32(math.random())
end

function p.wrap(frame)
	local args = frame.args
	local hash = makeHash()
	local output = args.collapsible
	output = mw.ustring.gsub(
		output,
		'%%collapsibleId%%',
		'mw-customcollapsible-nav-' .. hash,
		1
	)
	output = mw.ustring.gsub(
		output,
		'%%toggleId%%',
		'mw-customtoggle-nav-' .. hash,
		1
	)
	return output
end

return p