notes-cli icon indicating copy to clipboard operation
notes-cli copied to clipboard

produce valid markdown

Open snoblenet opened this issue 6 years ago • 7 comments

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

snoblenet avatar Jul 07 '19 22:07 snoblenet

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

rhysd avatar Jul 08 '19 13:07 rhysd

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.)

snoblenet avatar Jul 08 '19 23:07 snoblenet

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

rhysd avatar Jul 10 '19 12:07 rhysd

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 avatar Jul 10 '19 12:07 rhysd

Does this actually break some markdown parser?

rhysd avatar Jul 10 '19 12:07 rhysd

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

snoblenet avatar Jul 11 '19 03:07 snoblenet

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

snoblenet avatar Jul 11 '19 03:07 snoblenet