Module:Sandbox: Difference between revisionsGive feedback
No edit summary |
No edit summary |
||
| Line 32: | Line 32: | ||
local function process_newlines(text) | local function process_newlines(text) | ||
if not text then return text end | if not text then return text end | ||
-- First replace the | -- First replace the \"n with a special marker | ||
text = text:gsub('\\"n', ' | text = text:gsub('\\"n', 'NEWLINE_MARKER') | ||
-- Then replace | -- Then replace the marker with <br> | ||
text = text:gsub(' | text = text:gsub('NEWLINE_MARKER', '<br>') | ||
return text | return text | ||
end | end | ||
| Line 89: | Line 89: | ||
-- Process newlines and return | -- Process newlines and return | ||
label = process_newlines(label) | |||
return label | |||
end | end | ||
| Line 98: | Line 99: | ||
local result = p._search_string(label, lang_code_override) | local result = p._search_string(label, lang_code_override) | ||
result = process_newlines(result) | |||
return result | |||
end | end | ||