Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loose list appears unexpectedly when using tight lists #306

Open
iacore opened this issue Jun 20, 2024 · 4 comments
Open

loose list appears unexpectedly when using tight lists #306

iacore opened this issue Jun 20, 2024 · 4 comments

Comments

@iacore
Copy link

iacore commented Jun 20, 2024

I tried to write three separate lists. However, it turns out to be one loose list. This behavior is unintuitive to me. Maybe there could be a better heuristic to loose list rendering, or an option to turn it off?

- a
- b

- c

- d
- e

REL: jgm/djot.js#91

@jgm
Copy link
Owner

jgm commented Jun 20, 2024

The syntax description describes how we group list items into groups. Essentially, we group consecutive items of the same type, where the types are defined by marker style. One possible change would be to track whether the list item is followed by a blank line -- call these items "spaced" -- and say that a list containing nonspaced items can contain at most one spaced item, at the end, and a list containing spaced items can contain at most one nonspaced item, at the end.

@bpj
Copy link

bpj commented Jun 20, 2024

In the case at hand you can achieve three different tight lists by putting a comment between them:

- a
- b

{%x}
- c

{%x}
- d
- e

Not very pretty but it works!

@iacore
Copy link
Author

iacore commented Jun 20, 2024

my solution:

- a
- b

{}

- c

{}

- d
- e

@bpj
Copy link

bpj commented Jun 21, 2024

Oh, totally empty "attributes"! I didn't even consider that that might work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants