Skip to content

Inconsistent behaviour of <Enter> in bullet lists, leading to inconsistent line spacing of items #2310

Closed

Description

@axelsimon

Description

Bullet lists sometimes have single spacing and sometimes have double spacing.
You can check this by opening the text file with another text editor, such as vi: some items are separated by a singre newline caracter, some by newline, some spaces and then another newline.

  • Can you reproduce the issue?
    Not reliably. It seems that the double line spacing / adding extra line starts after MarkText gets confused regarding what is a new item in a bullet list and what is a new line.
    The <Enter> key doesn't reliably start a new item in bullet lists, and sometimes instead enters a new line and some spaces (6, in my case). This prompts MarkText to start displaying those list items with double line spacing.

Steps to reproduce

N/A

Expected behaviour:

Pressing the key always does the same thing when in a bullet list. Entering a newline when in a bullet list should be only possible when pressing <shift + Enter>.
Marktext maintains consistent spacing of bullet lists.
Trying to delete and recreate a > between bullet list items doesn't produce different results (sometimes single line spacing, sometimes double).

Actual behaviour:
key sometimes starts a new list item, sometimes starts a new line that doesn't start with a bullet.

Some bullet lists items are separated by an extra blank line and some spaces, rendering as double spacing in MarkText.
Some bullet lists items are not separated by an extra blank line, rendering as single spacing in MarkText.

Link to an example: [optional]
In normal mode:
Screenshot from 2020-08-20 10-42-13

Actual text, as shown in source code mode:
Screenshot from 2020-08-20 10-48-15

Versions

  • Mark Text version: 0.16.2 (Flatpak)
  • Operating system: Fedora 32

Activity

  1. brainchild0 commented on Aug 21, 2020

    @brainchild0
    Contributor

    The source produced by the application should express a consistent rule about the count of empty lines between list items.

    Note that in Markdown, parsing is the same regardless of whether one or no empty line separates the items. I think that the difference between Enter versus Shift + Enter is not related to this particular issue because the application is correctly generating a new list item each time the user presses Enter. The problem is the inconsistency in the appearance of the document source.

  2. brainchild0 commented on Aug 28, 2020

    @brainchild0
    Contributor

    Suggest renaming to Inconsistent line spacing of list items in output.

    (If keyboard action is inconsistent, then it probably should be reported separately.)

  3. brainchild0 commented on Aug 28, 2020

    @brainchild0
    Contributor

    Closely related to #2286.

  4. axelsimon commented on Sep 2, 2020

    @axelsimon
    Author

    Suggest renaming to Inconsistent line spacing of list items in output.

    (If keyboard action is inconsistent, then it probably should be reported separately.)

    Actually, i initially thought i was reporting the display bug, but as i investigated more realised i the really underlying issue is the keyboard input bug. This issue (#2310) is, at the end of the day, for that bug: Enter doesn't reliably enter a new line, sometimes it enters a newline and several (6?) spaces.

  5. brainchild0 commented on Sep 3, 2020

    @brainchild0
    Contributor

    Thank you for the new information.

    If you identify the problem as related to keyboard input, then please try to discover whether the same problem occurs for the same keystrokes regardless of context in the document. If so, then you might consider revising the current presentation of the issue, or you might consider closing the issue, to begin again with a clean issue topic.

    Note that other keyboard issues have been reported (see #2235), and any information that helps diagnose whether this issue is related to them is useful. Which country keyboard layout do you use? Does the issue reproduce in version 0.15.1?

    It is also helpful if you can report an instance of the problem in which key strokes that should produce one presentation actually result in a different presentation.

  6. ivy-rew commented on Dec 30, 2023

    @ivy-rew
    Contributor

    This seems fixed today by a feature-flag:
    Menu > File > Preferences > Markdown > Untoggle "List: Prefer loose list items"
    Disabling it; I get the "normal" list behavior back, not adding extra new-lines.
    MarkText_002

  7. clooptu commented on Mar 9, 2025

    @clooptu

    This seems fixed today by a feature-flag: Menu > File > Preferences > Markdown > Untoggle "List: Prefer loose list items" Disabling it; I get the "normal" list behavior back, not adding extra new-lines. MarkText_002

    Thank you very much , it works!

  8. added
    🐛 bug
    🪲 pri/major
    🦏 list block
    on May 16, 2026
  9. Jocs commented on Jun 22, 2026

    @Jocs
    Member

    Thank you for reporting this. The inconsistent Enter-key behavior you described (sometimes creating a new bullet item, sometimes inserting a newline + spaces, and the resulting mixed blank-line spacing in the output) was a bug in the old editor engine (muyajs 0.16).

    MarkText has since migrated to a new editor engine (@muyajs/core). In the new engine the "loose vs tight" property is stored once on the list itself (meta.loose) and applied uniformly to every item during serialization — there is no per-keystroke variation. The preferLooseListItem preference (Menu → File → Preferences → Markdown → "List: Prefer loose list items") now controls this consistently for all items in a list.

    Two community members confirmed this in the comments (2023-12-30 and 2025-03-09): toggling that preference restores the expected behavior. Closing as resolved by the engine migration. Please open a new issue if you encounter a regression on a current release.

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/major🐛 bug🔭 area/editor🦏 list block

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions