Can not save string to dgraph is it has '\n'

the text is from the textarea tag in the page, if text is multiple line, will get a while unquoting: invalid syntax error when save it to dgraph, how do deal with this situation?

Try to double escape the string.