Zettelkasten Forum


[Markdown Best Practices] Needing a space for lists to be recognized

Can someone with more historical knowledge of markdown or coding explain to me why most markdown processors require a space between a paragraph and a list for the list to be recognized as a list? Does it have to be the best practice for future-proofing notes?

Comments

  • The reason I ask is because I much prefer not having to add a space for every list. It decreases the amount of relevant text I can see on screen at any given time. My current solution is to make the paragraph a list too.

    The danger in doing that is although it looks better in The Archive, it won't look proper upon export to outside formats.

  • It's a corollary from what I explained here:
    https://forum.zettelkasten.de/discussion/698/markdown-best-practices-two-spaces-new-line-lame

    The Markdown parser starts at "Can", figures this is a paragraph because the first characters encountered are not declaring anything special. It then stops figuring out where the block ends at the next best line separator. You can say that paragraphs are parsed "greedily", swallowing every other block markup that is not separated by an empty line.

    Author at Zettelkasten.de • https://christiantietze.de/

  • This is probably my single biggest pet peeve with Markdown (or at least with many Markdown parsers).

    I have a ton of lists in my notes, typically with relatively short "titles" and only a few list items each, like in the following example:

    Potentially interesting add-ons:
    - Syntax Highlighting for Code (https://ankiweb.net/shared/info/1463041493)
    - Image Occlusion Enhanced (https://ankiweb.net/shared/info/1111933094)
    

    I would absolutely hate to include empty lines between the list "title" and the following bullet points. It not only wastes space, it also visually disconnects the list "titles" from the rest of the lists.

    So I decided a long time ago to just stick with the format shown above. It doesn't happen very often that I send (parts of) my notes to external Markdown parsers, and whenever I run into issues, I can just do a quick search and replace to add the missing empty lines. The same holds true should I ever, heaven forbid, switch from The Archive to a different notes applications.

    This is, by the way, one of the reasons why I decided to use the regular text color for list numbers and bullet points in the PrettyFunctional themes, so the bullet points always look the same.

    If you like The Archive's "PrettyFunctional (Basic)" theme, consider upgrading to the "PrettyFunctional (Regular)" theme.

  • Two excellent pieces of information and commentary.

    @ctietze said:
    You can say that paragraphs are parsed "greedily", swallowing every other block markup that is not separated by an empty line.

    @basil said:
    This is, by the way, one of the reasons why I decided to use the regular text color for list numbers and bullet points in the PrettyFunctional themes, so the bullet points always look the same.

    @basil I really like my specially colored bullet points, but I reluctantly admit that I agree with your choices in the land of Greedily Parsed Paragraphs.

Sign In or Register to comment.