[FIX] web_editor: remove copy paste unwanted newline
Before this commit: - When you try to paste text beside a text which is in code formate it puts the new text in new line with smaller font. - When we try to paste text in code formate in new line then it will give a blank space below the pasted text After this commit: - when you try to paste text beside a text which is in code formate it puts the pasted text in new line with original fontsize. - When we paste the text in code formate in new line then it will not give a empty line below it, Task-2683455 closes odoo/odoo#106488 X-original-commit: bf7835e80ffa70236dca4b4b8fb4edb45d42f46a Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This commit is contained in:
committed by
Hiral Bhavsar
parent
05348b8b03
commit
ff366852fe
@@ -20,6 +20,7 @@ import {
|
||||
isBlock,
|
||||
isColorGradient,
|
||||
isContentTextNode,
|
||||
isEmptyBlock,
|
||||
isSelectionFormat,
|
||||
isShrunkBlock,
|
||||
isVisible,
|
||||
@@ -262,6 +263,9 @@ export const editorCommands = {
|
||||
if (offset) {
|
||||
const [left, right] = splitElement(currentNode.parentElement, offset);
|
||||
currentNode = insertBefore ? right : left;
|
||||
if (isEmptyBlock(right)) {
|
||||
right.remove();
|
||||
}
|
||||
} else {
|
||||
currentNode = currentNode.parentElement;
|
||||
}
|
||||
|
||||
@@ -1443,6 +1443,7 @@ const paragraphRelatedElements = [
|
||||
'H4',
|
||||
'H5',
|
||||
'H6',
|
||||
'PRE',
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user