Support text merge with multiline text

When text to be merged has line feeds, these line feeds are currently ignored. Add support to allow to use multiline text as merged text.