add mulitline support for writing textelements containing "\n"