wysiwyg-editor icon indicating copy to clipboard operation
wysiwyg-editor copied to clipboard

Clear formatting plugin fails with script error in some cases.

Open bjornri opened this issue 6 years ago • 1 comments

Expected behavior

The formatting should be cleared.

Actual behavior.

The formatting isn't cleared and a script error is printed in devtools.

Steps to reproduce the problem.

Using this fiddle: https://jsfiddle.net/xp8ezhj3/2/ do the following steps:

  1. Click in editor
  2. Type text 'test1' and press enter
  3. Type text 'test2'
  4. Press Ctrl+A to select all text
  5. Press Ctrl+B to make the text bold
  6. While the bold text is still selected, click the 'clear formatting' toolbar icon with the mouse.
  7. Notice the formatting isnt cleared
Editor version.

3.0.5

OS.

Windows 10

Browser.

Firefox 68.0.2 Edge 44.18362.267.0 Chrome 76.0.3809.100 IE11

Recording.

Can create one if necessary

bjornri avatar Aug 26 '19 11:08 bjornri

This seems to happen when selecting a string of text that is itself wrapped in a closing tag. After selecting, if I switch to code view, it's clear that the closing tag is not part of the selection which I wonder is part of the cause:

https://user-images.githubusercontent.com/5510974/190485529-374246fd-c727-4c00-afba-31c75a7781c6.mov

Selecting all and then clearing formatting works as expected.

essmahr avatar Sep 15 '22 18:09 essmahr