summaryrefslogtreecommitdiff
path: root/doc/reference/javascript_reference.rst
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2018-06-11 15:26:16 +0200
committerNicolas Lempereur <nle@odoo.com>2018-06-13 16:20:40 +0200
commitc4ddf55880b7aa83580aa8ab312ba71f093a7587 (patch)
treefd7693d86ed121d817a86fe953789c53d09c17ad /doc/reference/javascript_reference.rst
parenta8dd1de5c466b64351d54536ac0529d2a744cf4d (diff)
[FIX] web_editor: link don't duplicate child text
If we applied a link eg. on: ``` <span>hello <b>world</b></span> ``` The system actually gets the "label": hello worldworld because there is 3 nodes: text node: hello element node: `<b>world</b>` text node: world Also since "hello worldworld" is different than "hello world", instead of just keeping existing nodes and adding the link, the system would replace the selected range by: `<span><a>hello worldworld</a></span>' instead of: `<span><a>hello </a><b><a>world</a></b></span>` This commit ignores element nodes when creating a new link, since when getting the label of the link from the selection, only the text nodes insides the element nodes have any interest. There was a second issue because if we had: ``` <i><a href="hello">world</a></i>! ``` and tried to put a link over "world!", the code would decide: "world" is inside a link so we will just update that link. Thus we would get: ``` <i><a href="hello">world!</a></i>! ``` instead of: ``` <i><a href="hello">world</a></i><a href="hello">!</a> ``` opw-1848351 closes #25187
Diffstat (limited to 'doc/reference/javascript_reference.rst')
0 files changed, 0 insertions, 0 deletions