Skip to content

[Bug]: wrong formatting with nested lists and comments #468

@dodomorandi

Description

@dodomorandi

What happened?

I found a specific combination of things that trigger a mis-formatting. If I am not wrong all the following elements are necessary to trigger the issue:

  • You have a nested list
  • The first nested item of the list is followed by a comment
  • There are at least two items in the second level of the list
  • Text wrapping is enabled

What happens is that the first nested item is formatted in the same line of the parent list element, which should obviously not happen.

A workaround is simply to add an empty comment after the parent list element.

Playground link

https://typstyle-rs.github.io/typstyle/playground/?wrapText=true&code=LQAgKgpgzgLglgOwOYCgQlACQgGxwexAHoAqEAY3wFsqIEYQSi0MQB1fAJxwBMg

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions