odoo/odoo#195018

Created by Editor, Adnan Saiyed (adsa)
Merged at 761c92a43e41137c80641afda0b3a3c99ccc6d82

Statuses:

label
odoo-dev:18.0-remove-empty-format-adsa
head
0486101d6be704cc20deb257de6fa52693536629
merged
6 months ago by Editor, David Monjoie (dmo)
odoo/odoo
18.0 #195018
saas-18.1 #207560
saas-18.2 #207599
saas-18.3 #207612
saas-18.4
19.0
master #209528

[FIX] html_editor: remove empty format tags

Behavior before this PR:

  • Create a bold or italic tag using keyboard when selection is collapsed, leave it empty.
  • Change selection using arrow key.
  • Put cursor back where format tag was created.

Notice that empty element is not removed and text is formatted when writing something.

Behavior after PR is merged:

  • This PR makes sure that empty format element gets removed when changing selection.
  • Tag will not get removed if it's parent block element is empty.

task-4240818


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr