Skip to content

Commit

Permalink
Merge pull request #18 from hugojosefson/whitespace
Browse files Browse the repository at this point in the history
Fix multi-line text paragraphs
  • Loading branch information
ryansolid committed Jul 18, 2020
2 parents af0626a + 3529163 commit 4979f5f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export function trimWhitespace(text) {
.split("\n")
.map((t, i) => (i ? t.replace(/^\s*/g, "") : t))
.filter(s => !/^\s*$/.test(s))
.join("");
.join(" ");
}
return text.replace(/\s+/g, " ");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ const multiLineTrailingSpace = <span>
John
</span>

/* prettier-ignore */
const multiLineNoTrailingSpace = <span>
Hello
John
</span>

/* prettier-ignore */
const escape = <span>
&nbsp;&lt;Hi&gt;&nbsp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,7 @@ const multiLine = _tmpl$7.cloneNode(true);
const multiLineTrailingSpace = _tmpl$3.cloneNode(true);
/* prettier-ignore */

const multiLineNoTrailingSpace = _tmpl$3.cloneNode(true);
/* prettier-ignore */

const escape = _tmpl$8.cloneNode(true);

0 comments on commit 4979f5f

Please sign in to comment.