Module:script utilities: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 84: Line 84:
if not sc then
if not sc then
sc = require("Module:scripts").findBestScript(text, lang)
sc = require("Module:scripts").findBestScript(text, lang)
end
-- Replace space characters with newlines in Mongolian-script text, which is written top-to-bottom.
if sc and sc:getDirection() == "down" and text:find(" ") then
text = munge_text(text, function(txt)
-- having extra parentheses makes sure only the first return value gets through
return (txt:gsub(" +", "<br>"))
end)
end
end