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

no-missing-blank-lines should allow for tight lists #85

Closed
localjo opened this issue Aug 11, 2016 · 6 comments
Closed

no-missing-blank-lines should allow for tight lists #85

localjo opened this issue Aug 11, 2016 · 6 comments
Labels
🗄 area/interface This affects the public interface 💪 phase/solved Post is done 🧒 semver/minor This is backwards-compatible change 🦋 type/enhancement This is great to have

Comments

@localjo
Copy link

localjo commented Aug 11, 2016

I'm trying to add a table of contents which has multiple levels to a readme file. It should look like this;

- [Installation](#installation)
- [Usage](#usage)
  - [Options](#options)
  - [Reports](#reports)
  - [Custom Dictionary](#custom-dictionary)
  - [Changing Default Rules](#changing-default-rules)
- [Writing Standards](#writing-standards)
- [Troubleshooting](#troubleshooting)
- [Contribute](#contribute)
- [License](#license)

But when I run in through remark-lint, it says "Missing blank line before block node no-missing-blank-lines". To fix the warning, I have to turn off the rule (not ideal, because I do want to check for proper spacing between nodes) or format the block like this;

- [Installation](#installation)
- [Usage](#usage)

  - [Options](#options)
  - [Reports](#reports)
  - [Custom Dictionary](#custom-dictionary)
  - [Changing Default Rules](#changing-default-rules)
- [Writing Standards](#writing-standards)
- [Troubleshooting](#troubleshooting)
- [Contribute](#contribute)
- [License](#license)

Which renders incorrectly on GitHub and npm;

This issue is similar to #79

@localjo
Copy link
Author

localjo commented Aug 11, 2016

For now I'm turning off this rule in quality-docs, https://github.com/SparkartGroupInc/quality-docs/blob/master/sample-rules-override.json#L11

Hopefully I can find a way to re-enable it soon.

@wooorm
Copy link
Member

wooorm commented Aug 13, 2016

It’s not a bug, it’s exactly what this rule is for. In that list item, there’s a paragraph and a list (which are block-levels), so no-missing-blank-lines thinks there should be a blank between them.

Hopefully I can find a way to re-enable it soon.

Use comments? Or PR support for passing in exceptions (I’d appreciate it!)

@wooorm wooorm closed this as completed Aug 13, 2016
@bkeepers
Copy link

I just ran into this as well. Most markdown implementations have different behavior for list items depending on the white space around them. If there is a blank line between list items, then they will wrap the list item in a paragraph (as @josiahsprague's example shows above). If there is not blank line between list items, then there will be no paragraph tag.

I understand that this complicates the implementation, but I feel like ignoring this rule for nested lists would be consistent with real-world use of markdown.

@wooorm wooorm reopened this Aug 14, 2016
@wooorm
Copy link
Member

wooorm commented Aug 14, 2016

@bkeepers Appreciate the input. Re-opening so we can track it.

From what I gather, this issue relates to an exception for a paragraph followed by a list, in a list item?

So:

- Paragraph
  - Nested

Yields:

  • Paragraph
    • Nested

...and is allowed.

@wooorm wooorm added help wanted 🙏 This could use your insight or help 🦋 type/enhancement This is great to have 🧑 semver/major This is a change needs pr and removed help wanted 🙏 This could use your insight or help labels Aug 14, 2016
@bkeepers
Copy link

From what I gather, this issue relates to an exception for a paragraph followed by a list, in a list item?

Yep. Thanks for taking this into consideration. I looked into implementing it, but I'm still getting familiar with the remark code and it wasn't quite obvious to me the best way to solve it.

@wooorm wooorm changed the title no-missing-blank-lines rule shouldn't apply in indented lists no-missing-blank-lines should allow for tight lists Aug 14, 2016
@wooorm wooorm closed this as completed in a4085f2 Aug 14, 2016
@wooorm wooorm added 🧒 semver/minor This is backwards-compatible change and removed 🧑 semver/major This is a change labels Aug 14, 2016
@wooorm
Copy link
Member

wooorm commented Aug 14, 2016

Thanks both for convincing me this was needed. 👍 I’ll release it in a minute.

@bkeepers Appreciate you looking in. I think it’s a pretty hard project to get into, lots of moving parts. I’d like to make it easier to get into but I’m not really sure how to. If you’ve got any pointers I’d love to hear them (as issues, or Gitter, or whatnot).

Cheers!

bkeepers added a commit to github/opensource.guide that referenced this issue Aug 15, 2016
...with an exception for tight, nested lists. remarkjs/remark-lint#85
@wooorm wooorm added ⛵️ status/released 🗄 area/interface This affects the public interface labels Aug 15, 2019
@wooorm wooorm added the 💪 phase/solved Post is done label Aug 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🗄 area/interface This affects the public interface 💪 phase/solved Post is done 🧒 semver/minor This is backwards-compatible change 🦋 type/enhancement This is great to have
Development

No branches or pull requests

3 participants