platers / obsidian-linter

An Obsidian plugin that formats and styles your notes with a focus on configurability and extensibility.
https://platers.github.io/obsidian-linter/
MIT License
1.24k stars 82 forks source link

FR: Empty line around horizontal rules #1170

Closed thomas-forbes closed 1 month ago

thomas-forbes commented 1 month ago

Is Your Feature Request Related to a Problem? Please Describe.

I would like the same functionality that adds empty lines to headings, blockquotes, etc but for horizontal rules.

I use horizontal rules to separate thoughts in the same way as headings but without providing a title. Linter can add empty lines around headings and I would like the same empty lines around horizontal rules.

Describe the Solution You'd Like

I only want it to add spaces around actual horizontal rules not triple dashes that are used for frontmatter.

Example:

---
prop: value
---

# h1
asdf
---
qwer
---
prop: value
---

# h1

asdf

---

qwer

Describe Alternatives You've Considered

I tried to come with regex to do it but after a few failed attempts by chatgpt o1 I gave up.