Module:Sandbox/Tamzin/First word nowrap

local p = {} local getArgs = require('Module:Arguments').getArgs

function p.main(frame) local args = getArgs(frame) return p._main(args) end

function p._main(args) local pre = args['pre'] or "" if pre ~= "" then pre = pre .. " "	end local tag = args['tag'] or "span" local words = mw.text.split(args[1], " ") words[1] = words[1] .. ""	if #words > 1 and tag ~= "span" then words[2] = "<" .. tag .. ">" .. words[2] words[#words] = words[#words] .. ""	end return "<" .. tag .. " class='nowrap'>" .. pre .. table.concat(words, " ") end

return p