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

Bug fix - Native Editor inner formatting action #4695

Merged
merged 4 commits into from
Jan 8, 2024

Conversation

tonisevener
Copy link
Collaborator

@tonisevener tonisevener commented Dec 7, 2023

Phabricator:
N/A

Notes

This is a bug I noticed when comparing inner formatting with Android and Code Mirror. When selecting formatted inner text (i.e. not the entire string), it it expected that it removes formatting by surrounding the section in opposing strings, e.g.:

From:
Testing <s>Strikethrough text here</s>

To:
Testing <s>Strikethrough </s>text<s> here</s>

If you were to highlight "text" and toggle off strikethrough.

This PR applies this logic for our current formatters, bold, italics and templates.

Test Steps

  1. In Staging on editor, select 3 words and bold them.
  2. Highlight the second word and deselect Bold toolbar button
  3. Confirm second word is surrounded by wikitext bold marks and is no longer formatted as bold. Select Bold toolbar button again.
  4. Confirm second word is no longer surrounded by wikitext bold marks and is formatted as bold again.

Screenshots/Videos

Before:
out1

After:
out2

@tonisevener tonisevener requested review from a team and mazevedofs and removed request for a team December 8, 2023 22:51
@mazevedofs mazevedofs merged commit 9ba2a3d into main Jan 8, 2024
@mazevedofs mazevedofs deleted the native-editor-inner-formatting-action-fix branch January 8, 2024 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants