Files
odoo_source/addons/web_editor/static/lib/odoo-editor
abd-msyukyu-odoo 42a42ebcfb [IMP] web_editor: flag only editable as unremovable
Prior to this change, if a contenteditable=true element was a child of a
contenteditable=false element, it was always flagged as unremovable=true.

In fact what should happen is that this.editable should be unremovable, but one
of its subchildren can be contenteditable=true while having a parent
contenteditable=false and not be unremovable.

Task-id: 2794990
X-original-commit: 72e2fd7439a0d6e44b5082def35079019371a3b7
Part-of: odoo/odoo#88733
2022-04-14 10:50:07 +02:00
..
…

Odoo editor

A fast wysiwyg editor targeting documents and website structures.

Key features

Unbreakable nodes

When editing some sections of a website, there is a possibility for a selection to start or end within a node that is contained in an unbreakable.

If the user deletes the content of the selection, the unbreakable node should not be merged with another one.

Demo

To open the demo page: http://<host:port>/web_editor/static/lib/odoo-editor/demo/index.html

Tests

To open the test page, go to http://<host:port>/web_editor/static/lib/odoo-editor/test/editor-test.html

Prettify

# install prettier
npm install -g prettier
# prettify
prettier --config '<odoo-path>/addons/web_editor/static/lib/odoo-editor/_prettierrc.js' --ignore-path='<odoo-path>/odoo/addons/web_editor/static/lib/odoo-editor/_prettierignore' '<odoo-path>/odoo/addons/web_editor/static/lib/odoo-editor/**/*.js'  --write

Prettify with vscode

Install vscode extention esbenp.prettier-vscode.

Add the following configuration in your vscode user config or workspace config:

"prettier.requireConfig": true,
"prettier.configPath": "<odoo-path>/odoo/addons/web_editor/static/lib/odoo-editor/.prettierrc.js",
"[javascript]": {
  "editor.defaultFormatter": "esbenp.prettier-vscode"
}

Then you can use the command Format Document or use ctrl+h to format a file.