[FIX] web_editor: escape html tag when copy paste code and text content
closes odoo/odoo#33859 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
This commit is contained in:
@@ -780,7 +780,10 @@ var TextPlugin = AbstractPlugin.extend({
|
||||
clipboardData = e.originalEvent.clipboardData.getData('text/plain');
|
||||
// get that text as an array of text nodes separated by <br> where needed
|
||||
var allNewlines = /\n/g;
|
||||
clipboardData = $('<p>' + clipboardData.replace(allNewlines, '<br>') + '</p>').contents().toArray();
|
||||
clipboardData = _.str.trim(clipboardData)
|
||||
.replace(/</g, '<').replace(/>/g, '>')
|
||||
.replace(allNewlines, '<br>');
|
||||
clipboardData = $('<p>' + clipboardData + '</p>').contents().toArray();
|
||||
}
|
||||
|
||||
// Delete selection
|
||||
|
||||
Reference in New Issue
Block a user