FR: Allow FullWidth Space Removal to Only Affect Space Not at Start or End of Line
See original GitHub issueDescribe the Bug
Both trailing spaces rules are set to true
:
"Trailing spaces": {
"Removes extra spaces after every line.": true,
"Two Space Linebreak": true
}
When a line ends with full width punctuation (e.g. ,
, ;
or )
),the trailing spaces are all trimmed on lint, which makes the “two space linebreak” rule invalid.
How to Reproduce
before: (note that the first line has 2 trailing spaces to represent a linebreak)
- 测试文本;
测试文本。
- 测试文本。
after:
- 测试文本;
测试文本。
- 测试文本。
Issue Analytics
- State:
- Created a year ago
- Comments:7
Top Results From Across the Web
How whitespace is handled by HTML, CSS, and in the DOM
This means that: There will be some text nodes that contain only whitespace, and. Some text nodes will have whitespace at the beginning...
Read more >How to remove the white space at the start of the string
You want to remove the space (i.e whitespace) at the beginning of the string. So, could not use standard jquesy .trim() . You...
Read more >How to Restrict Start and End Spaces in string - ServiceNow
Hi, Using below script unable to restrict spaces in start and end of string. it's working only if the space in middle of...
Read more >space-first' (trim-start-except-first-line) as a normal behavior ...
Specifies the baseline behavior, equivalent to 'space-first allow-end trim-adjacent'. space-first. Set fullwidth opening punctuation with ...
Read more >When does white space matter in HTML? | by Patrick Brosset
White space is any string of text composed only of spaces, tabs or line breaks (to be precise, either CRLF sequences, carriage returns...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That may be the case, but a couple rules have some overlap in what they do.
I think adding an option to ignore whitespace at the start and end of a line makes the most sense to let users decide if they want fullwidth to remove such spaces.
But still, in this case, I suggest handling trailing and in-between spaces separately. That’s to say the rule “Remove Space around Fullwidth Characters” should ignore spaces at end since trailing spaces are more of a linebreak behavior relative to “Trailing spaces” rule.