Skip to content

Commit

Permalink
block-string: print multi line for trailing backslash
Browse files Browse the repository at this point in the history
  • Loading branch information
thenamankumar committed May 17, 2020
1 parent e01cfa8 commit dbbbe34
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/language/blockString.js
Expand Up @@ -85,8 +85,12 @@ export function printBlockString(
const isSingleLine = value.indexOf('\n') === -1;
const hasLeadingSpace = value[0] === ' ' || value[0] === '\t';
const hasTrailingQuote = value[value.length - 1] === '"';
const hasTrailingSlash = value[value.length - 1] === '\\';
const printAsMultipleLines =
!isSingleLine || hasTrailingQuote || preferMultipleLines;
!isSingleLine ||
hasTrailingQuote ||
hasTrailingSlash ||
preferMultipleLines;

let result = '';
// Format a multi-line block quote to account for leading space.
Expand Down

0 comments on commit dbbbe34

Please sign in to comment.