Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: [Consecutive Blank Lines]: Whitespace in consecutive empty lines results in them not being removed upon linting #529

Closed
1 of 2 tasks
Gewerd-Strauss opened this issue Dec 2, 2022 · 5 comments · Fixed by #530
Assignees
Labels
bug Something isn't working markdown General Markdown or Markdown related issue or feature resolution/update-made A change has been made that should resolve this issue or request

Comments

@Gewerd-Strauss
Copy link

Gewerd-Strauss commented Dec 2, 2022

Describe the Bug

The rule Consecutive Blank lines is supposed to condense any number of blank lines into one. "Blank" is an arbitrary word in this case, because - at least to me - it suggests that lines containing solely whitespace (spaces, tabs, etc) should be treated as empty - after all, they don't contain printable characters.

How to Reproduce

Steps to reproduce the behavior:

  1. Create a note
  2. Paste the contents of this codeblock
A

B
				 

the above "emtpy" lines **are not** merged into one line because the upper one contains spaces (but no printable characters)



the above empty lines _do_ get reduced to one line because they are truely empty, aka don't contain whitespace
  1. run the linter with the above-mentioned setting activated.

Expected Behavior

I'd expect that a line containing pure whitespace is treated as an empty line (and is considered for the purpose of the rule). This means that any number of lines (≥2) that contain either

  1. no characters at all, or
  2. any combination of whitespace characters, e.g. tabs, spaces, newlines, line feeds, carriage returns, ...

are to be considered empty, and therefore removed by the linter.
Expected output if applicable:

A

B

the above "emtpy" lines are not merged into one line because the upper one contains spaces (but no printable characters)

the above empty lines **do get reduced** to one line because they are truely empty, aka don't contain whitespace

Actual output:

A

B
				 

the above "emtpy" lines are not merged into one line because the upper one contains spaces (but no printable characters)

the above empty lines _do_ get reduced to one line because they are truely empty, aka don't contain whitespace

Screenshots

/

Device

  • Desktop
  • Mobile, not checked on mobile

Additional Context

Version/Installer Version: 1.0.3
Plugin Version: 1.8.0

@Gewerd-Strauss Gewerd-Strauss added the bug Something isn't working label Dec 2, 2022
@pjkaufman
Copy link
Collaborator

To handle this, we would need to change the consecutive line regex to include ([\t\v\f\r \u00a0\u2000-\u200b\u2028-\u2029\u3000]+)? as suggested here.

@pjkaufman
Copy link
Collaborator

I believe that I have a fix for this that will be merged in shortly.

@pjkaufman pjkaufman moved this to Backlog in Obsidian Linter Dec 2, 2022
@pjkaufman pjkaufman added the markdown General Markdown or Markdown related issue or feature label Dec 2, 2022
@pjkaufman pjkaufman moved this from Backlog to In Progress in Obsidian Linter Dec 2, 2022
@pjkaufman pjkaufman self-assigned this Dec 2, 2022
Repository owner moved this from In Progress to Releasing in Obsidian Linter Dec 2, 2022
@pjkaufman
Copy link
Collaborator

This should be fixed on master and in the next release. Please let us know if the issue still exists on master or in the next release.

@pjkaufman pjkaufman added the resolution/update-made A change has been made that should resolve this issue or request label Dec 2, 2022
@Gewerd-Strauss
Copy link
Author

I'll check it once we have a release for me to check, as I always have issues attempting to install from sourcecode properly.

@pjkaufman
Copy link
Collaborator

Sounds good. I may be able to create a release tomorrow, but we will see. There have been enough bug fixes and features merged in to go ahead and do a release.

@pjkaufman pjkaufman moved this from Releasing to Done in Obsidian Linter Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working markdown General Markdown or Markdown related issue or feature resolution/update-made A change has been made that should resolve this issue or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants