From 2c14a7f13c0723b290f9267cdd02165b50f1e3ea Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Wed, 23 Oct 2019 21:57:00 +0300 Subject: [PATCH] docs on whitespace sensitivity: better wording (#6699) --- website/blog/2018-11-07-1.15.0.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/website/blog/2018-11-07-1.15.0.md b/website/blog/2018-11-07-1.15.0.md index 288a06bd..26ed13a7 100644 --- a/website/blog/2018-11-07-1.15.0.md +++ b/website/blog/2018-11-07-1.15.0.md @@ -37,7 +37,7 @@ As you may notice during daily HTML works, the following two cases won't produce | with spaces | `1 2 3` | 1 2 3 | | without spaces | `123` | 123 | -This is because whitespaces are sensitive in inline elements. +This happens because whitespace is significant in inline elements. For this reason, we cannot safely format @@ -59,8 +59,8 @@ since it may modify the displayed output in the browser. Instead of breaking your code or just doing nothing, we introduce _whitespace-sensitive formatting_, which: -- follows the default CSS `display` value for every element to identify if the whitespace is sensitive, -- and borrows the opening or closing tags (if necessary) to avoid adding or removing sensitive whitespaces. +- follows the default CSS `display` value for every element to identify if the whitespace inside it is significant, +- and wraps the tags in such a way as to avoid adding or removing significant whitespace. For example: @@ -81,7 +81,7 @@ For example: ``` -We also allow magic comments (e.g., ``) to tell Prettier how to format this element +We also allow magic comments (e.g., ``) to tell Prettier how to format elements due to the fact that CSS display can be changed: @@ -98,13 +98,13 @@ due to the fact that CSS display can be changed: ``` There's also an option for the global whitespace sensitivity -in case you may want maximum safety or you just don't care about those whitespaces: +in case you may want maximum safety or you just don't care about that whitespace: `--html-whitespace-sensitivity` (defaults to `css`) - `css` - Respect the default value of CSS `display` property. -- `strict` - Whitespaces are considered sensitive. -- `ignore` - Whitespaces are considered insensitive. +- `strict` - All whitespace is considered significant. +- `ignore` - All whitespace is considered insignificant. ##### Automatic parser inference