Skip to content

Fix an issue where highlighting a format would error#204

Merged
dkotter merged 1 commit into10up:developfrom
jrmd:fix/highlight-error
Jul 12, 2023
Merged

Fix an issue where highlighting a format would error#204
dkotter merged 1 commit into10up:developfrom
jrmd:fix/highlight-error

Conversation

@jrmd
Copy link
Contributor

@jrmd jrmd commented Jul 12, 2023

Description of the Change

This PR fixes an issue where highlighting a newly inserted special character that has no formatting will cause the block to error. The change alters how the character is inserted by specifically targeting the correct start/end and setting the formats array to an empty array instead of [ undefined ] (the source of the error).

Closes #203

How to test the Change

  1. Add some text to a paragraph
  2. Insert a special character
  3. Highlight the text using a mouse
  4. ensure it doesn't error

Video of the change in action

Screen.Recording.2023-07-12.at.14.34.48.mov

Changelog Entry

Fixed - Highlighting a special character that has no formats crashes the block

Checklist:

  • I agree to follow this project's Code of Conduct.
  • All new and existing tests pass.

@jrmd jrmd requested a review from a team as a code owner July 12, 2023 13:36
@jrmd jrmd requested review from dkotter and removed request for a team July 12, 2023 13:36
@dkotter dkotter added this to the 1.1.0 milestone Jul 12, 2023
@dkotter dkotter merged commit b381105 into 10up:develop Jul 12, 2023
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.

Gutenberg Block crashes after inserting and selecting Special-Char

2 participants