Files
odoo_source/addons/web_editor/static/lib/odoo-editor
Antoine Guenet ad7c0d8ea4 [FIX] web_editor: prevent traceback on remove highlight color
This prevents a traceback when no closest block to the root node can be
found in the sanitizer.

task-2796371

closes odoo/odoo#87187

X-original-commit: 2104f33985472cd59f067d2f1403518a332fac6d
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-03-24 18:10:51 +01: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.