From bd14979e9b6d90acffe9e72d96be313050287da9 Mon Sep 17 00:00:00 2001 From: xiaochong0302 Date: Sun, 5 May 2024 21:52:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=BC=96=E8=BE=91=E5=99=A8ht?= =?UTF-8?q?mlTags=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/admin/js/content.editor.js | 15 ++++++++++++++- public/static/home/js/content.editor.js | 13 ++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/public/static/admin/js/content.editor.js b/public/static/admin/js/content.editor.js index 60b32074..c14cbb7a 100644 --- a/public/static/admin/js/content.editor.js +++ b/public/static/admin/js/content.editor.js @@ -17,7 +17,20 @@ layui.use(['jquery'], function () { 'image', 'link', 'unlink', '|', 'source', 'about' ], - pasteType: 1, + htmlTags: { + span: ['.color', '.background-color'], + a: ['id', 'class', 'href', 'target', 'name'], + img: ['id', 'class', 'src', 'width', 'height', 'alt', 'title'], + table: ['id', 'class'], + div: ['id', 'class'], + pre: ['id', 'class'], + hr: ['id', 'class'], + embed: ['id', 'class', 'src', 'width', 'height', 'type', 'loop', 'autostart', 'quality', 'align', 'wmode'], + iframe: ['id', 'class', 'src', 'width', 'height'], + 'td,th': ['id', 'class'], + 'p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6': ['id', 'class'], + 'br,tbody,tr,strong,b,sub,sup,em,i,u,strike,s,del': ['id', 'class'], + }, extraFileUploadParams: { csrf_token: $('meta[name="csrf-token"]').attr('content') } diff --git a/public/static/home/js/content.editor.js b/public/static/home/js/content.editor.js index 269d8aab..01c091f3 100644 --- a/public/static/home/js/content.editor.js +++ b/public/static/home/js/content.editor.js @@ -17,7 +17,18 @@ layui.use(['jquery'], function () { 'image', 'link', 'unlink', '|', 'source', 'about' ], - pasteType: 1, + htmlTags: { + span: ['.color', '.background-color'], + a: ['id', 'class', 'href', 'target', 'name'], + img: ['id', 'class', 'src', 'width', 'height', 'alt', 'title'], + table: ['id', 'class'], + div: ['id', 'class'], + pre: ['id', 'class'], + hr: ['id', 'class'], + 'td,th': ['id', 'class'], + 'p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6': ['id', 'class'], + 'br,tbody,tr,strong,b,sub,sup,em,i,u,strike,s,del': ['id', 'class'], + }, extraFileUploadParams: { csrf_token: $('meta[name="csrf-token"]').attr('content') }