obsidian-linter: Bug: Empty Line Around Tables not respected

Describe the Bug

“Empty Line Around Tables” option is enabled in Linter but when the command is ran it removes all empty lines between a Header and the table

How to Reproduce

Steps to reproduce the behavior:

  1. Enable “Empty Line Around Tables”
  2. In a document (not beginning or end) create a H2, create an empty line and add a table after the header
  3. Run Linter
  4. Empty line between H2 and table is removed and table is not rendered properly

Example to reproduce issue with

## Logical operators

| Operator | Meaning                  | Example               |
|----------|--------------------------|-----------------------|
|`==`| Is Equal To              | 3 == 5 gives us False |
|`!=`| Not Equal To             | 3 != 5 gives us True  |
|`>`| Greater Than             | 3 > 5 gives us False  |
|`<` | Less Than                | 3 < 5 gives us True   |
|`>=`| Greater Than or Equal To | 3 >= 5 give us False  |
|`<=`|Less Than or Equal To|3 <= 5 gives us True |

Log

Running linter Running Format Tags in YAML Running Format Yaml Array Running Move Tags to Yaml Running Remove Trailing Punctuation in Heading Running Convert Bullet List Markers Running Remove Consecutive List Markers Running Remove Empty List Markers Running Remove Hyphenated Line Breaks Running Remove Multiple Spaces Running Two Spaces Between Lines with Content Running Compact YAML Running Consecutive blank lines Running Empty Line Around Blockquotes Running Empty Line Around Code Fences Running Empty Line Around Math Blocks Running Empty Line Around Tables Running Heading blank lines Running Remove Empty Lines Between List Markers and Checklists Running Remove link spacing Running Space after list markers Running Trailing spaces Running Custom Regex Running Capitalize Headings Running Custom Lint Commands

Expected Behavior

There should be one empty line between the H2 and the table

Screenshots

Before image

After image

Device

  • [ x] Desktop
  • Mobile

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 1
  • Comments: 19 (1 by maintainers)

Commits related to this issue

Most upvoted comments

I have pushed up a potential fix for this. It is now on master. So it should go out with the next release. Please let us know if it is not fixed in that release.

The change made was to make it so that Heading Blank Lines does not remove multiple blank lines after any heading* when bottom = false.

*: There is an exception to this according to the code, but I am not sure how to describe it since I was not around when the rule was written and I currently do not understand its use in the code.