Skip to content

Editor | Fix | Preserve underline marks when splitting a line - #3378

Open
dajiaohuang wants to merge 1 commit into
anyproto:mainfrom
dajiaohuang:3323-PreserveUnderlineMarks-w17-20261025
Open

dajiaohuang wants to merge 1 commit into
anyproto:mainfrom
dajiaohuang:3323-PreserveUnderlineMarks-w17-20261025

Conversation

@dajiaohuang

Copy link
Copy Markdown
  • I understand that contributing to this repository will require me to agree with the CLA

Description

The renderer creates core_ui.common.Underline, which implements Span, for Markup.Mark.Underline. However, Editable.extractMarks() has no branch for this span and drops it through else -> null. EditorFragment passes this extraction into onEnterKeyClicked, so the split-line operation loses underline marks while retaining bold and italic marks. The extraction is also used by text updates and backspace operations.

Map Underline to Mark.Type.UNDERLINE, retaining its start/end offsets just like the other formatting spans. Add a regression to the existing MarkupExtractTest that renders and extracts an underline at a nonzero offset.

What type of PR is this?

  • Bug Fix
  • Test

Related Tickets & Documents

Fixes #3323.

Testing results

  • git diff --check: passes.
  • Source-path verification: renderer creates the custom underline span; the original extraction has no corresponding branch; Enter uses that extraction.
  • Robolectric regression, Android compilation, and device verification were not run. This isolated checkout has no github.properties, apikeys.properties, or SDK configuration. settings.gradle unconditionally loads GitHub Packages credentials for the middleware dependency, and the native workflow uses repository secrets. No credentials were fabricated or copied and no user workspace/device was accessed. The new test is included for execution in the normal project environment.

Mobile & Desktop Screenshots/Recordings

No layout changes. The reported behavior is documented in #3323; no device verification is claimed here.

Added tests?

  • yes — should extract underline span in the existing Robolectric suite (not run locally).

Added to documentation?

  • no documentation needed

AI assistance was used to prepare this narrowly scoped change and its source-path review.

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@dajiaohuang

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

This branch has not been deployed

No deployments
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.

Enter clears underline text formatting

1 participant