If it's a multi line string, than you must have a new line character at the end of each line (e.g \n)
You can use the replace filter and see if you can remove the new line character e.g.
var multilinestring = {{body|safe|replace("\n", " ")}} // not tested