diff --git a/src/doc-printer.js b/src/doc-printer.js index afe6fe4c..b1945f8f 100644 --- a/src/doc-printer.js +++ b/src/doc-printer.js @@ -271,7 +271,7 @@ function printDocToString(doc, options) { const content = parts[0]; const contentFlatCmd = [ind, MODE_FLAT, content]; const contentBreakCmd = [ind, MODE_BREAK, content]; - const contentFits = fits(contentFlatCmd, [], width - rem, true); + const contentFits = fits(contentFlatCmd, [], rem, true); if (parts.length === 1) { if (contentFits) { diff --git a/tests/jsx-significant-space/__snapshots__/jsfmt.spec.js.snap b/tests/jsx-significant-space/__snapshots__/jsfmt.spec.js.snap index bd645504..97440b5d 100644 --- a/tests/jsx-significant-space/__snapshots__/jsfmt.spec.js.snap +++ b/tests/jsx-significant-space/__snapshots__/jsfmt.spec.js.snap @@ -109,9 +109,7 @@ before = ( before_break1 = ( - {" "} + {" "} foo ); diff --git a/tests/jsx-text-wrap/__snapshots__/jsfmt.spec.js.snap b/tests/jsx-text-wrap/__snapshots__/jsfmt.spec.js.snap index 39e66786..214a30b7 100644 --- a/tests/jsx-text-wrap/__snapshots__/jsfmt.spec.js.snap +++ b/tests/jsx-text-wrap/__snapshots__/jsfmt.spec.js.snap @@ -469,7 +469,11 @@ facebook_translation_leave_text_around_tag = ( this_really_should_split_across_lines = (
- before{stuff}after{stuff}after{stuff}after{stuff}after{stuff}after{stuff}after{stuff}after{stuff}after{stuff}after{stuff}after{stuff}after{stuff}after{stuff}after{stuff}after + before{stuff}after{stuff}after{stuff}after{stuff}after{stuff}after{stuff}after{ + stuff + }after{stuff}after{stuff}after{stuff}after{stuff}after{stuff}after{stuff}after{ + stuff + }after
); @@ -651,9 +655,7 @@ jsx_whitespace_after_tag = ( x = (
- ENDS IN
- text text text text text text text text text text text -
{" "} + ENDS IN
text text text text text text text text text text text
{" "} HRS
);