Skip to content

Empty paragraphs are dropped on save – edit mode and view mode diverge #9243

Description

@FesTGig

Describe the bug
When pressing Enter to create empty lines (empty paragraphs) in edit mode, they are shown correctly while editing. After leaving edit mode, all empty paragraphs are gone in the
rendered view. This makes it very hard to structure pages
in Collectives, e.g. meeting notes with visual spacing between dated sections.

To Reproduce

  1. Open a page in Collectives (or a .md file in Text)
  2. Write a paragraph, press Enter 2–3 times, write another paragraph
  3. Leave edit mode / reload the page
  4. The empty lines are gone

Expected behavior
Empty paragraphs survive the markdown round trip, so edit and view mode look the same.

Cause
An empty paragraph serializes to the same \n\n as a regular paragraph separator,
so it is lost when converting to markdown and parsing it again.

Possible solution
Serialize empty paragraphs as   (and parse a paragraph containing only
  back into an empty paragraph), similar to what tiptap does in
ueberdosis/tiptap#8356 for empty paragraphs next to lists.

Related

Server details

  • Collectives: 4.6.1
  • Text: 8.0.0
  • Nextcloud: 34.0.4

Activity

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions