From 510210ad3d19d44a853176a20eb9c549e9370f83 Mon Sep 17 00:00:00 2001 From: jessikitty Date: Tue, 26 May 2026 10:19:37 +1000 Subject: [PATCH] =?UTF-8?q?fix:=20Pasted=20tables=20=E2=80=94=20auto-width?= =?UTF-8?q?=20columns,=201px=20solid=20black=20borders,=20remove=20colgrou?= =?UTF-8?q?ps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Views/Slides/Create.cshtml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Views/Slides/Create.cshtml b/Views/Slides/Create.cshtml index 94fa964..0fc8465 100644 --- a/Views/Slides/Create.cshtml +++ b/Views/Slides/Create.cshtml @@ -108,11 +108,15 @@ paste_data_images: true, paste_webkit_styles: 'all', paste_postprocess: function(editor, args) { + args.node.querySelectorAll('colgroup').forEach(function(cg) { cg.remove(); }); args.node.querySelectorAll('*').forEach(function(el) { var tag = el.tagName.toLowerCase(); var isTablePart = (tag === 'td' || tag === 'th' || tag === 'table' || tag === 'tr'); if (el.style.color && !isTablePart) el.style.color = '#000'; if (el.style.backgroundColor && !isTablePart) el.style.backgroundColor = ''; + if (tag === 'col' || tag === 'td' || tag === 'th' || tag === 'table') { el.removeAttribute('width'); el.style.width = ''; } + if (tag === 'td' || tag === 'th') { el.style.border = '1px solid #000'; el.style.padding = '6px 10px'; } + if (tag === 'table') { el.style.borderCollapse = 'collapse'; el.removeAttribute('border'); el.removeAttribute('cellspacing'); el.removeAttribute('cellpadding'); } }); }, valid_styles: {