08645e8e2ed1b967f9c425c428e66074ca54f6d7
Sometimes, two similar adjacent elements must be merged together (eg,
two `<span>` elements with the same style, or two lists of the same
type). This is done by the sanitizer, which is called on the common
ancestor of the mutated nodes after each change, and on the whole
editable when the document is saved. In the case of nested lists, this
can cause a visible discrepancy between what is saved and what is
edited:
1. In a list, say the first item contains a nested bullet list, and the
second item contains a nested numbered list:
`<li><ul>...</ul><li><ol>...</ol></li>`
2. Now we transform the numbered list into a bullet list:
`<li><ul>...</ul><li><ul>...</ul></li>`
3. The mutation happened on the second `<li>` element so we call the
sanitizer on it, and it doesn't have enough context information to
merge the two `<li>` elements, so it leaves them as is.
4. The user saves the document, and the sanitizer is called on the
whole editable, which has enough context information to merge the
two `<li>` elements, so it does so, and the saved document is
different from what the user sees. It is now `<li><ul>...</ul></li>`
as it should have been immediately after the mutation.
We solve this in a straight-forward, ad-hoc way since we currently know
of no other case where this is needed, by calling the sanitizer on the
parent of the first ancestor nested list of the mutated nodes, if any.
closes odoo/odoo#111871
X-original-commit: 50b7b41a4573fdce8891fac5d6aa1d08c557d455
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
…
Odoo
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
Getting started with Odoo
For a standard installation please follow the Setup instructions from the documentation.
To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%