WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.5k stars 4.2k forks source link

A text selection which exactly matches a markup inline style does not replace the text when typing. #44263

Open merlijnvanlent opened 2 years ago

merlijnvanlent commented 2 years ago

Description

Typing when text is selected replaces the selected text with whatever you are typing. However, when a text selection matches a Marked piece of text the selection is not replaced.

Step-by-step reproduction instructions

  1. When editing a post
  2. Create a piece of text with a marked colour
  3. Select the exact same characters as the earlier marked text.
  4. Start typing the new text.
  5. Text is not replaced.

Screenshots, screen recording, code snippet

https://user-images.githubusercontent.com/10158014/191013023-843d93e4-b3b8-4305-8815-870e99fd5cae.mov

Please see the bottom left corner of the screen for keystrokes. :)

Environment info

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

artemiomorales commented 2 years ago

Confirmed in the following environment:

dnwjn commented 1 year ago

Unfortunately this is still an issue with the following versions:

ellatrix commented 1 year ago

Unfortunately I cannot reproduce this. Is this still an issue in WP 6.3?

dnwjn commented 1 year ago

Unfortunately I cannot reproduce this. Is this still an issue in WP 6.3?

I'm sorry to report it still is. I've tested this on a fresh WP 6.3 install, and the following situation is an example of when it doesn't work:

Screenshot ![image](https://github.com/WordPress/gutenberg/assets/57711725/b9fb52b0-8c19-4456-b0fa-748f6838ffa4)
Post content ```html

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus neque lectus, vulputate id odio vel, elementum gravida eros. Quisque pretium rhoncus metus et congue. Donec dignissim purus eu turpis sagittis rhoncus. Aliquam at enim turpis. Aliquam leo odio, aliquet ac justo in, finibus suscipit arcu. Maecenas semper suscipit arcu. Nunc posuere porta lobortis.

Ut finibus tincidunt dapibus. Mauris consequat tellus tellus, vel laoreet mi auctor convallis. Pellentesque sed finibus augue, at ornare neque. Ut varius purus sed sem ultricies aliquet. Morbi sagittis commodo sapien viverra dignissim. Morbi ultrices ipsum ut diam luctus tincidunt. Praesent varius consequat dui, id pellentesque ante accumsan non. Maecenas vel rhoncus ligula, vel placerat arcu. Nullam eget tincidunt orci. Cras finibus facilisis elit, vitae consequat purus dignissim et. Fusce a risus nisi. Nulla in mattis tellus. Aliquam feugiat, erat ac viverra fringilla, magna justo interdum quam, quis elementum neque ligula quis leo.

Donec odio mi, cursus non accumsan cursus, tincidunt id ligula. Duis accumsan euismod nulla. Nam quis tempus ante. Nullam scelerisque, dolor ac laoreet bibendum, neque massa vestibulum augue, a gravida enim magna imperdiet lacus. Ut eget consequat purus. Donec vestibulum augue in urna semper consectetur. Pellentesque in placerat purus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Mauris laoreet sit amet massa sit amet egestas. Aenean imperdiet eu justo eu interdum. Quisque interdum nunc nisl, et commodo magna maximus at. Sed eu tortor eget sem iaculis eleifend. Ut id nisl in lectus sollicitudin interdum vel eu neque. Sed sit amet scelerisque tellus, nec molestie ante. Aliquam nec gravida ante.

```