fix: use multiline only when input is a string

this function gets called at a point where the input could be something other than a string.