Files
odoo_source/addons/web_editor
David Monjoie f163958330 [REF] web_editor: merge insertion commands into one
Prior to this commit, we had three insertion commands:
* insertText: takes a string and insert a text node containing it
* insertHtml: takes a string, convert it to elements on the fly and insert them
* insertFragment: takes a fragment element and insert it in the dom

With this commit, we now have a single one polymorphic command `insert` that
accepts two types of arguments:
* string: inserts a text node with the provided string as text
* node:  insert the provided node in the dom

The new `insert` command does **not** support the previous case of `insertHtml`
which used to convert string into html on the fly. No more magically hidden
conversions ! No more need to construct a fragment yourself like was needed for
`insertFragent` either. If you need to convert string into html, notably for
hardcoded fixed html, you can use the `parseHTML` util which returns a frament
containing the parsed nodes which can be given to `insert` directly..

closes odoo/odoo#99536

Related: odoo/enterprise#31081
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-09-06 21:23:49 +02:00
..
…