Open kasperosterbye opened 2 years ago
Based on what I read, I see the following suggestion for how Microdown could work wrt lists.
My proposal is that a list item is ended when
This also gives the ways in which a list item is not ended, in particular
a blank line can be inserted into a list item by space-indenting an empty line the number of spaces needed by the list item.
That is, if an item is indented 4 spaces, a blank line can be added by indenting the newline 4 spaces.
A list (or nested list) is ended when the item is ended, and the next block is not a new item for the list.
1. bla
foo
- bla bla2.
bar
new line with no indent
The ordered list (of one item) is ended because it is followed by a block which is not an ordered list item. The unordered list (of one item) is ended because it is followed by a block which is not an unordered list item.
new line with no indent
Normally numbered list can accept any number in the input. That is
1. bla
1. bla
1. bla
gives a numbered list 1. 2. 3.
I suggest we follow the convention that the first item specify the starting number:
5. bla
1. bla
1. bla
gives numbered list 5. 6. 7.
Moved as issue from long thread on lse-microdown mailing list.
Please also remember that we are not implementing markdown and the strange rule github uses. Even markdown editors sometimes are not following any reasonable rules. Like putting an - after a list break the previous element in macdown.
So I think that we should have what we think is good. And not some crazy shit.
S
On 22 Jul 2022, at 06:35, Kasper Osterbye [kasper.osterbye@gmail.com](mailto:kasper.osterbye@gmail.com) wrote:
Hernán
I found the “Markdown philosophy” section https://daringfireball.net/projects/markdown/syntax#philosophy to be quite informative.
In general I believe it is better to take such technical discussions as issues in github than here on the mailing list. I at least often search old closed issues on github for Pharo to see if something odd has been discussed before.
Best,
Kasper
On 22 Jul 2022, at 01.28, Hernán Morales Durand [hernan.morales@gmail.com](mailto:hernan.morales@gmail.com) wrote:
Hi Kasper,
Thanks for your email. I just tried in a gist and indeed Github Markdown cannot break a list with a new line. See https://gist.github.com/hernanmd/842cb08db14ab8a19c5da5efabb314d9 This is surprising given that it is used everywhere.
I just read some threads about automatic list numbering in an editor: https://youtrack.jetbrains.com/issue/IDEA-292704/Do-not-automatically-number-lists-in-markdown, very interesting to understand editor re-numbering, but not so much about avoid resuming list numbering. TL;DR: they seem to rely on a linter to configure similar stuff (https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md#md029---ordered-list-item-prefix). If you like this path I could open an issue for Microdown Linter but this is another subject probably for the future.
About the Markdown list auto-numbering, it seems that writing normal text (below a numbered item) breaks the consumption of line items. And writing 4 spaces will indent text to belong to the list item, preventing from breaking the auto-numbering (https://stackoverflow.com/questions/18088955/markdown-continue-numbered-list)
Let me know if you want me to open an issue on this too.
Cheers,
Hernán
El jue, 21 jul 2022 a las 7:10, Kasper Osterbye ([kasper.osterbye@gmail.com](mailto:kasper.osterbye@gmail.com)) escribió: Cheers Hernán
I have no answer off hand. It is part of Markdown I would like to understand better one day. I find indentation and breaking of lists in any markdown to be surprising - and in microdown as well.
When I run into an example like you mention here, I normally try in github and a markdown editor to see what those do.
For example, I have not yet found a why to break a numbered list in anyway using github markdown.
Foo 1
Foo 2
Foo 3 How to format the above to get
Foo 1
Foo 2
Foo 3
Besides the parsing issues, the Text rendering in Microdown is troublesome with too many CR added for my taste. I would like to fix this as well when I have found a way to clearly understand the whole thing.
Sorry I am no real help.
Best,
Kasper