Skip to content

Commit

Permalink
Add indents before interpolated code if necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Quadflieg committed Oct 23, 2019
1 parent 8552bf1 commit 5cd1721
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,11 +435,17 @@ export const plugin: Plugin = {
break;
}
case 'interpolated-code':
if (
previousToken &&
(previousToken.type === 'tag' || previousToken.type === 'end-attributes')
) {
result += ' ';
if (previousToken) {
switch (previousToken.type) {
case 'tag':
case 'end-attributes':
result += ' ';
break;
case 'indent':
result = printIndent(previousToken, result, indent, indentLevel);
result += '| ';
break;
}
}
result += `#{${token.val}}`;
break;
Expand Down

0 comments on commit 5cd1721

Please sign in to comment.