Skip to content

Commit

Permalink
Fix multi-line formatting
Browse files Browse the repository at this point in the history
FIxes the issue described in adamzapasnik#130. It seems that `embedTextToDoc` is returning a string and not an object with a `parts` array.
  • Loading branch information
grncdr authored Jan 7, 2023
1 parent 613fc24 commit 4755d72
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/formatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const formatMultilineExpressions = (tokens, options, embedTextToDoc) => {
try {
if (!formatRaw) {
formattedExpression = embedTextToDoc(expression, { ...options, parser: 'ruby' });
formattedExpression.parts.pop(); // removes newline at the end
formattedExpression = formattedExpression.trim(); // removes newline at the end
}
} catch (error) {
formatRaw = true;
Expand Down

0 comments on commit 4755d72

Please sign in to comment.