From a9c0182f5edea538f6e30024da9b80f3eab0d841 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chyeonggkim=E2=80=9D?= <“hyeonggkim@smilegate.com”> Date: Thu, 29 Jan 2026 21:21:33 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=BB=A4=EC=8A=A4=ED=85=80=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=20customContentReady=20=ED=95=A8=EC=88=98?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layers/plugins/dompurify-html.ts | 34 +++-- layers/templates/CtLayout01/index.vue | 191 +++++++++++++++++++------- 2 files changed, 168 insertions(+), 57 deletions(-) diff --git a/layers/plugins/dompurify-html.ts b/layers/plugins/dompurify-html.ts index 461ee31..d6c7258 100644 --- a/layers/plugins/dompurify-html.ts +++ b/layers/plugins/dompurify-html.ts @@ -1,3 +1,4 @@ +// @ts-ignore import DOMPurify from 'dompurify' import type { DirectiveBinding } from 'vue' @@ -35,9 +36,12 @@ const commonTags = [ 'thead', 'tbody', 'tfoot', + 'video', + 'source', 'tr', 'th', 'td', + 'section', ] as const // 공통 허용 속성 @@ -55,16 +59,20 @@ const commonAttrs = [ 'colspan', 'rowspan', 'scope', + 'type', + 'autoplay', + 'muted', + 'loop', + 'playsinline', + 'controls', + 'preload', + 'poster', ] as const // 기본 설정 (일반 사용자용) const defaultConfig: DOMPurifyConfig = { - ALLOWED_TAGS: [ - ...commonTags - ], - ALLOWED_ATTR: [ - ...commonAttrs - ], + ALLOWED_TAGS: [...commonTags], + ALLOWED_ATTR: [...commonAttrs], } // 관리자용 설정 (확장된 태그 및 속성) @@ -74,6 +82,7 @@ const adminConfig: DOMPurifyConfig = { 'iframe', 'link', 'style', + 'script', 'blockquote', ], ALLOWED_ATTR: [ @@ -133,16 +142,21 @@ function createDirectiveHandler(config: DOMPurifyConfig) { } } -export default defineNuxtPlugin((nuxtApp) => { +export default defineNuxtPlugin(nuxtApp => { // SSR 환경에서는 디렉티브 등록하지 않음 // if (!import.meta.client) { // return // } // 기본 디렉티브: v-dompurify-html - nuxtApp.vueApp.directive('dompurify-html', createDirectiveHandler(defaultConfig)) + nuxtApp.vueApp.directive( + 'dompurify-html', + createDirectiveHandler(defaultConfig) + ) // 관리자용 디렉티브: v-dompurify-admin - nuxtApp.vueApp.directive('dompurify-admin', createDirectiveHandler(adminConfig)) + nuxtApp.vueApp.directive( + 'dompurify-admin', + createDirectiveHandler(adminConfig) + ) }) - diff --git a/layers/templates/CtLayout01/index.vue b/layers/templates/CtLayout01/index.vue index d0f99b6..756d709 100644 --- a/layers/templates/CtLayout01/index.vue +++ b/layers/templates/CtLayout01/index.vue @@ -1,9 +1,23 @@ @@ -575,11 +677,6 @@ v-dompurify-admin="customContentsHtml" class="custom-container" > -
- {{ tm('Newreturnevent_Section03_Title') }} -