Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix collab editor line break disappear issue #552

Merged
merged 4 commits into from
Oct 25, 2023
Merged

Conversation

MrOrz
Copy link
Member

@MrOrz MrOrz commented Oct 24, 2023

Fixes #550

Acceptance criteria

  • Website can load transcripts newly created by AI (one paragraph with \ns)
  • Website can load human edited transcript (with multiple paragraphs)
  • When the user edits content, all paragraphs stay as-is
  • When the user press enter, one single \n is added, with no new paragraphs created.
  • History still works

Screenshot

Can load AI generated transcript (multiple \ns)

line-break-preserved.mp4

History can still work

history-still-wrok.mp4

- Just leave a paragraph (block) and text
- Official doc: It is recommended to always require at least one child node in nodes that have block content ( https://prosemirror.net/docs/guide/#schema )
- Also serve as backward-compatibility as well as for future sections
- exampleSetup will create new paragraphs on enter
- We actually just need inserting \n
- Ref: baseKeymap's Enter binding https://github.com/ProseMirror/prosemirror-commands/blob/master/src/commands.ts#L293C17-L293C17
@coveralls
Copy link

Coverage Status

coverage: 76.218%. remained the same when pulling c39cc79 on collab-line-break into 2b90d06 on master.

@MrOrz MrOrz requested a review from nonumpa October 24, 2023 17:28
@MrOrz MrOrz self-assigned this Oct 24, 2023
@MrOrz MrOrz marked this pull request as ready for review October 24, 2023 17:28
@MrOrz MrOrz temporarily deployed to staging-tw October 24, 2023 17:35 — with GitHub Actions Inactive
@MrOrz MrOrz temporarily deployed to staging-en October 24, 2023 17:35 — with GitHub Actions Inactive
@MrOrz MrOrz temporarily deployed to staging-ja October 24, 2023 17:35 — with GitHub Actions Inactive
@MrOrz MrOrz merged commit 53690ec into master Oct 25, 2023
10 checks passed
@MrOrz MrOrz deleted the collab-line-break branch October 25, 2023 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Paragraphs may disappear when editing AI generated transcript
5 participants