Skip to content

[Bug] Muya inserts blank lines between adjacent bullet and task items #5257

Closed

Description

@DePasqualeOrg

Description

Muya inserts a blank line between adjacent bullet and task items when serializing Markdown. This changes a tight list into a loose list even when no spacing change was requested.

Steps to Reproduce

Parse and serialize this Markdown with Muya (packages/muya):

- A bullet
- [ ] A task

Expected Behavior

The list should remain unchanged, with no blank line between its items.

Actual Behavior

Muya produces:

- A bullet

- [ ] A task

The same problem occurs with the task item first and with mixed lists nested inside an ordered item. Authored loose spacing should still be preserved.

Operating System

Linux (Other).

MarkText Version

Muya @muyajs/core 0.2.0 from develop, tested on 6 September 2026. This reproduction uses the engine directly, not a packaged desktop release.

OS Version

Debian 12 container.

Reproducibility

The automated serialization regressions reliably reproduce the problem on unchanged upstream code.

Related PR: #5254.

Activity

  1. Jocs commented on Sep 7, 2026

    @Jocs
    Member

    MarkText treat

    - A bullet
    - [ ] A task
    

    as two list, one is bullet list and another is task list. so add one blank line between them when format.

  2. added
    🦁 need discuss
    on Sep 7, 2026
  3. DePasqualeOrg commented on Sep 7, 2026

    @DePasqualeOrg
    Author

    Please see the full analysis with relevant references here: #5254 (comment)

  4. Jocs commented on Sep 8, 2026

    @Jocs
    Member

    I think there are two possible approaches to solve this problem:

    - foo
    
    - [x] bar
    1. Parse above markdown into two separate tight lists.
    - foo
    - [x] bar

    Parse above markdown as a single list during Markdown parsing instead of splitting them into two lists.

    However, at the moment, both approaches seem to require a fairly significant amount of work, so neither is particularly attractive.

  5. added
    🪲 pri/low
    on Sep 8, 2026
  6. Jocs commented on Oct 27, 2026

    @Jocs
    Member

    Re-tested the reported Muya parse → serialize behavior against commit e8c602c. The original reproduction now stays unchanged, with no blank line inserted:

    - A bullet
    - [ ] A task

    Verification covered eight cases: the original example, task-first ordering, alternating plain/task runs, both orderings nested inside an ordered item, authored loose spacing in both orderings, and a loose parent containing a tight mixed child list. Each case passed three consecutive parse/serialize round trips, preserving both the expected Markdown and the parsed structure. Together with the existing list serialization suite, all 60 tests passed.

    The repository also has regression coverage for adjacent plain/task list runs. Related list fixes include #5854 and #5872.

    Closing as resolved for the serialization behavior reported here. This verification covers the source-level engine; it does not establish which published desktop release first includes the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🪲 pri/low🦁 need discuss

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions