Skip to content

Commit

Permalink
Handle multiline expression printing inside of script and pre like el…
Browse files Browse the repository at this point in the history
…ements (#60)
  • Loading branch information
adamzapasnik authored Jun 24, 2021
1 parent f564258 commit c47509a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/formatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit c47509a

Please sign in to comment.