rhysd / notes-cli

Small markdown note taking CLI app playing nicely with your favorite editor and other CLI tools
MIT License
218 stars 26 forks source link

produce valid markdown #4

Open snoblenet opened 5 years ago

snoblenet commented 5 years ago

Great tool. Can there be a blank line after the first heading please so the markdown is valid?

rhysd commented 5 years ago

Could you describe exact steps to reproduce this (your environment, setup, command executed, expected output)

snoblenet commented 5 years ago

Hi there.

At the cli type notes new foo bar batz.

Expected result:

bar
===

- Category: foo
- Tags: batz
- Created: 2019-07-09T09:04:12+10:00

(Valid Markdown, with blank line after H1.)

Actual result:

bar
===
- Category: foo
- Tags: batz
- Created: 2019-07-09T09:04:12+10:00

(Invalid Markdown, with no blank line after H1.)

rhysd commented 5 years ago

Thank you for the description. I'll look into this.

rhysd commented 5 years ago

It seems that your 'Actual result' is not an invalid markdown.

From [commonmark spec]()

In general, a setext heading need not be preceded or followed by a blank line. However, it cannot interrupt a paragraph, so when a setext heading comes after a paragraph, a blank line is needed between them.

So, === line just before list should be ok.

rhysd commented 5 years ago

Does this actually break some markdown parser?

snoblenet commented 5 years ago

Hi yes indeed it breaks this rule: https://github.com/updownpress/markdown-lint/blob/master/rules/022-blanks-around-headers.md

snoblenet commented 5 years ago

for now I've added a local .markdownlint.json to the notes-cli directly disabling 022 and 032