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

オープン
#9,243 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
70/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript, markdown

調査の方向性

The issue is in the markdown serialization/parsing logic of the Text app, likely in the tiptap/prosemirror integration. Look for the code that converts the editor's document model to markdown and back. The solution involves modifying the serializer to represent empty paragraphs with   and ensuring the parser correctly interprets them. Check existing tests for markdown handling to understand the current behavior and add a test for empty paragraph preservation.

索引モデルが issue の本文から書いたものです。

説明

bug

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

  • #902 (same behaviour, closed as duplicate of #593)
  • #593 (closed as not planned, but covers preserving external formatting,
    not empty paragraphs created in Text itself)

Server details

  • Collectives: 4.6.1
  • Text: 8.0.0
  • Nextcloud: 34.0.4
主要言語
JavaScript
スター
665
フォーク
133
平均マージ
1日 17時間
マージ済み PR(30日)
172

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

nextcloud/text のほかの issue

nextcloud/text の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。