Hacker News new | past | comments | ask | show | jobs | submit login

What odd newline requirements? I skimmed the syntax reference and couldn’t find any.



In markdown

    My favorite number is probably the number
    1. It's the smallest natural number that is
    > 0. With pencils, though, I prefer a
    # 2.
is a paragraph, a list item, a block quote, and a heading (4 things). In djot it's just a single paragraph.

If you want it to be 4 things you have to add a newline between each one.

Personally I think djot gets this right.


Agreed with the exception that djot also applies this to nested lists, which I think is a huge misstep. User ergonomics are more important than convenient parsing, and while many markdown parsers interpret your example in an un-ergonomic way, djot rejects this:

    - foo
    - bar
        - baz
    - foobar
and demands this:

    - foo
    - bar

        - baz

    - foobar
which is an unergonomic choice.


The motivation for this choice is not "convenient parsing" but deeper considerations of language design. As explained at https://github.com/jgm/djot#rationale , this choice follows from two desiderata: (1) "The syntax should compose uniformly, in the following sense: if a sequence of lines has a certain meaning outside a list item or block quote, it should have the same meaning inside it." (2) "The syntax should be friendly to hard-wrapping: hard-wrapping a paragraph should not lead to different interpretations, e.g. when a number followed by a period ends up at the beginning of a line." The document explains the compromise we made in commonmark to avoid the need for blank lines. Djot tries to be more principled.


This. The rationale of Djot's design decisions are sane. Heck, it's even understandable that lists 'require' the blank line. Yet blank lines in lists really break the reading flow. It would be worthwhile to sacrifice a pure design decision in favor of practicability and readability.


This is so horrifying I did not believe you and had to go test to make sure. Jesus that's awful. Force a newline on me before a list? Ugh but fine. Force it for every sub bullet? No freaking way, that looks catastrophically bad.

This forcing new lines thing almost totally eliminates any desire I have to experiment with it, when I was very excited about it when I first saw it come up. Hopefully they'll change their mind. They want source code to be readable then make a decision that makes our eyes bleed.


Ah, thanks. I agree that it makes sense to require an empty line before block elements that typically also require an empty line after.


Also preferring rST-style list syntax, requiring an empty line between parent and child lists.

So:

  - list
    - sublist
    - sublist
is valid Markdown but invalid djot, while

  - list
  
    - sublist
    - sublist
is valid djot.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: