Skip to content

Commit c47509a

Browse files
authored
Handle multiline expression printing inside of script and pre like elements (#60)
1 parent f564258 commit c47509a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/formatter.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ const formatMultilineExpressions = (tokens, options, embedTextToDoc) => {
7474
// prettier-html-templates can't handle objects in this case, only strings
7575
// TODO: multiline strings aren't formatted correctly, it'd be nice if we could pass the object
7676
// maybe it will be achievable with 2.3 prettier compability
77-
if (token.inElement && typeof token.content === 'object') {
77+
if (
78+
(token.inElement || token.inElementWithoutNeedToEncode || token.inScript) &&
79+
typeof token.content === 'object'
80+
) {
7881
const { formatted } = printDocToString(token.content, { ...options });
7982
token.content = formatted;
8083
}

0 commit comments

Comments
 (0)