obsidian-linter icon indicating copy to clipboard operation
obsidian-linter copied to clipboard

FR: Allow 'Heading Blank Lines' Blanks Between Headings Action to Be Configurable

Open qiaoxingxing opened this issue 1 year ago • 3 comments

The behavior of 'Heading Blank Lines' has changed after upgrading to v1.20.1.

I found that it is fixed by this issue: GitHub Issue 773

However, I have become accustomed to the old behavior. How can I ensure there are always blank lines before headings when bottom is disabled.

Here are my settings in Obsidian Linter:

  • Heading blank lines: enabled
  • Bottom: disabled

After upgrading to v1.20.1, the linter cannot add a blank line before headings when a heading is just before it.

For example:

In v1.20.0:

Before:

# heading
## heading
## heading

After: Adding blank lines between headings:

# heading

## heading

## heading

In v1.20.1:

Before:

# heading
## heading
## heading

After: Nothing changes:

# heading
## heading
## heading

qiaoxingxing avatar Nov 02 '23 04:11 qiaoxingxing

Hey @qiaoxingxing . A bug got fully removed with the patch you are referring to. Essentially before and after get muddle when no content is present between headers.

Thus what happens is bottom being set to false takes precedence. Thus blank lines between headings gets removed since they are below one heading and after another.

The only way to get around this would be one of the following:

  1. Turn bottom on
  2. Add custom regex to add the blank line
  3. FR for the ability to decide what happens to spaces between headers

pjkaufman avatar Nov 02 '23 09:11 pjkaufman

Hey @qiaoxingxing . I am planning on closing this soon since I have not heard back on this. Feel free to let us know if the 3 options listed above are not feasible or do not make sense.

pjkaufman avatar Nov 12 '23 17:11 pjkaufman

@pjkaufman, I truly appreciate your reply. All three options make sense to me, but I have decided to go with the fourth option: downgrading to the old version temporarily while waiting for the implementation of the third option. :)

qiaoxingxing avatar Nov 15 '23 15:11 qiaoxingxing