diff --git a/lib/formatter.js b/lib/formatter.js index 5d37f66..6ed94a9 100644 --- a/lib/formatter.js +++ b/lib/formatter.js @@ -74,7 +74,10 @@ const formatMultilineExpressions = (tokens, options, embedTextToDoc) => { // prettier-html-templates can't handle objects in this case, only strings // TODO: multiline strings aren't formatted correctly, it'd be nice if we could pass the object // maybe it will be achievable with 2.3 prettier compability - if (token.inElement && typeof token.content === 'object') { + if ( + (token.inElement || token.inElementWithoutNeedToEncode || token.inScript) && + typeof token.content === 'object' + ) { const { formatted } = printDocToString(token.content, { ...options }); token.content = formatted; }