question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FR: Allow FullWidth Space Removal to Only Affect Space Not at Start or End of Line

See original GitHub issue

Describe 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:open
  • Created a year ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
pjkaufmancommented, Aug 15, 2022

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.

0reactions
ben-yipcommented, Aug 15, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found