-
Type:
Bug
-
Resolution: Won't Fix
-
Priority:
Medium
-
None
-
Affects Version/s: 4.0
-
Component/s: None
-
Environment:
mac, webkit and FF
Steps to reproduce:
- create a new page
- CMD + B, then type some text and press enter (the "bold" style should carry to the new line created)
- press the "bullet" toolbar button to insert a bullet item
- start typing some text. The text will be normal unbolded text!. This is because for some reason the editor is not putting the text in the strong tag for some reason. This is what the bullet item markup looks like:
<ul><li>foo<strong></strong></li></ul>
Notice the text "foo" is outside the STRONG tags. What the?!?!?!?!?
- if you now delete the text inside the bullet you are left with a bullet that:
- cannot be cursor-ed into using the direction keys (but you can use your mouse to position the cursor inside). The reason why you can't cursor into it because <li><strong></strong></li> does not have a <br> in it.
- cannot be deleted using backspace (as there is a <strong></strong> inside it preventing it from being deleted)
See video for more details
Root cause
When you hit enter and carry a style format to the next line, the second paragraph looks like this before the bullet point is inserted:
<p><strong>first paragraph</strong></p> <p><strong><br></strong></p>
When the user now hits the bullet toolbar button (or uses autoformat or uses the CMD + SHIFT + B shortcut) you get:
<p><strong>first paragraph</strong></p> <p>CURSOR-IS-HERE!!!!<strong></strong></p>
Notice two things:
- the cursor is outside of the strong tags
- the strong tags don't have a BR tag inside it which is crucial to allow the cursor to be placed inside.
This is the root cause and everything goes downhill from here. We need to revise the code that creates a bullet item and ensure it handles the situation where there is some "styling" that is applicable to the current cursor position.