Module:Sandbox: Difference between revisionsGive feedback
No edit summary |
No edit summary |
||
| Line 27: | Line 27: | ||
return nil | return nil | ||
end | end | ||
end | |||
-- Helper function to handle newline conversion | |||
local function process_newlines(text) | |||
if not text then return text end | |||
-- First replace the escaped \"n with actual newline characters | |||
text = text:gsub('\\"n', '\n') | |||
-- Then replace newlines with <br> tags | |||
text = text:gsub('\n', '<br>') | |||
return text | |||
end | end | ||
| Line 78: | Line 88: | ||
end | end | ||
-- | -- Process newlines and return | ||
return process_newlines(label) | |||
end | end | ||
| Line 90: | Line 97: | ||
local lang_code_override = frame.args[2] | local lang_code_override = frame.args[2] | ||
local result = p._search_string(label, lang_code_override) | local result = p._search_string(label, lang_code_override) | ||
return process_newlines(result) | |||
return | |||
end | end | ||