260908_01_ENH: 이메일 템플릿에서 <area>, <map> 태그 사용 시 반투명 영역으로 가시화
This commit is contained in:
@@ -60,6 +60,7 @@ import {
|
||||
import {
|
||||
getEmailHtmlPolicyIssues,
|
||||
getEmailWysiwygCompatibility,
|
||||
hasImageMapMarkup,
|
||||
sanitizeEmailHtml,
|
||||
} from "@/components/message-template/emailHtmlPolicy";
|
||||
|
||||
@@ -609,6 +610,12 @@ const MessageTemplate = ({ pageTitle, defaultTemplate }: MessageTemplateProps) =
|
||||
/>
|
||||
)}
|
||||
|
||||
{!isSms && hasImageMapMarkup(selectedTemplate.tmplatBody) && (
|
||||
<p className="text-sm text-muted-foreground">
|
||||
※ <map>, <area> 가 사용된 경우 해당 영역이 반투명하게 보여집니다.
|
||||
</p>
|
||||
)}
|
||||
|
||||
{!isSms && (
|
||||
<div className="space-y-2">
|
||||
<div className="flex items-center justify-between">
|
||||
|
||||
@@ -190,6 +190,13 @@ export function getEmailHtmlPolicyIssues(html: string): string[] {
|
||||
return [...new Set(issues)];
|
||||
}
|
||||
|
||||
export function hasImageMapMarkup(html: string): boolean {
|
||||
if (!html) return false;
|
||||
const template = parseHtml(html);
|
||||
if (!template) return /<\s*(map|area)\b/i.test(html);
|
||||
return template.content.querySelector("map, area") !== null;
|
||||
}
|
||||
|
||||
export function sanitizeEmailHtml(html: string): string {
|
||||
if (!html) return "";
|
||||
const purifier = resolvePurifier();
|
||||
|
||||
Reference in New Issue
Block a user