Skip to content

fix(web): inline styles inheritance in newline#663

Open
kacperzolkiewski wants to merge 3 commits into
mainfrom
@kacperzolkiewski/fix-inline-styles-web
Open

fix(web): inline styles inheritance in newline#663
kacperzolkiewski wants to merge 3 commits into
mainfrom
@kacperzolkiewski/fix-inline-styles-web

Conversation

@kacperzolkiewski

Copy link
Copy Markdown
Collaborator

Summary

After tiptap upgrade: #655 when adding a newline inside e.g. bolded text caused that in newline inline style was wrongly inactive.

This PR fixes that behaviour.

Test Plan

  1. Toggle bold
  2. Type "Hello world"
  3. Go with the cursor in the middle of typed text
  4. press enter
  5. Type "hello"

Bold should still be active and text in second line should be bolded.

Screenshots / Videos

before:

Screen.Recording.2026-06-29.at.08.19.29.mov

after:

Screen.Recording.2026-06-29.at.08.18.24.mov

Compatibility

OS Implemented
iOS
Android
Web

Checklist

  • E2E tests are passing
  • Required E2E tests have been added (if applicable)

Copilot AI review requested due to automatic review settings June 29, 2026 06:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a regression after the Tiptap upgrade where pressing Enter inside inline-styled text could incorrectly deactivate the active inline mark for the new line (e.g., bold not being inherited).

Changes:

  • Update StrictMarksPlugin to only run its strict-mark reconciliation when the document or selection actually changes.
  • Add a Playwright E2E regression test covering Enter-in-the-middle-of-bold-followed-by-plain-text, ensuring bold remains active and typed text is bold.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/web/pmPlugins/StrictMarksPlugin.ts Avoids running strict-mark reconciliation on transactions that don’t change doc/selection, preventing incorrect stored-mark resets after Enter.
.playwright/tests/strictMarks.spec.ts Adds an E2E regression test validating bold inheritance/activation when inserting a newline mid-bold before plain text.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .playwright/tests/strictMarks.spec.ts
Comment thread .playwright/tests/strictMarks.spec.ts Outdated
kacperzolkiewski and others added 2 commits June 29, 2026 08:23
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@kacperzolkiewski kacperzolkiewski changed the title fix: inline styles inheritance in newline fix(web): inline styles inheritance in newline Jun 29, 2026
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.

3 participants