From 1f244ba40c209d1bf9ac1a1a382b159db38d8084 Mon Sep 17 00:00:00 2001 From: jessikitty Date: Tue, 26 May 2026 10:20:51 +1000 Subject: [PATCH] =?UTF-8?q?fix:=20Edit=20view=20=E2=80=94=20auto-width=20c?= =?UTF-8?q?olumns,=201px=20solid=20black=20borders=20on=20pasted=20tables?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Views/Slides/Edit.cshtml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Views/Slides/Edit.cshtml b/Views/Slides/Edit.cshtml index da493fb..8a30104 100644 --- a/Views/Slides/Edit.cshtml +++ b/Views/Slides/Edit.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: {