Brief summary of issue:
I was trying to make a substitute trigger that would replace a line with a line rebuilt from a trigger pattern.
When using deleteLine() to get rid of the original line, then echo() to add the replacement, any carriage returns or line feeds in the echo are drawn as unprintable characters.
Steps to reproduce the issue:
- Make a trigger
- Use deleteLine() in the code
- Use echo containing a carriage return or line feed
Error output
Expected output from this example trigger is an echo with properly handled newlines.
Here is example output of what is happening when using deleteLine:

And here is output with deleteLine() commented out:

The intent of the trigger was to remove padding in the [ ]'s (as an example)
The trigger code is this:
regex pattern: [(\w+)\s+](.*)
lua code:
deleteLine()
echo("\n["..matches[2].."]"..matches[3])
Extra information, such as the Mudlet version, operating system and ideas for how to solve:
Mudlet 4.19.1