에디터 정리 및 버그 수정
This commit is contained in:
@@ -250,9 +250,19 @@ export const buildStaticHtml = (blocks: Block[], projectConfig?: ProjectConfig):
|
||||
.filter(Boolean)
|
||||
.join(" ");
|
||||
|
||||
let innerHtml = escapeHtml(label);
|
||||
|
||||
if (typeof (props as any).imageSrc === "string" && (props as any).imageSrc.trim() !== "") {
|
||||
const imgSrc = escapeAttr((props as any).imageSrc.trim());
|
||||
const altRaw = (props as any).imageAlt as string | undefined;
|
||||
const altValue = altRaw && altRaw.trim() !== "" ? altRaw.trim() : label;
|
||||
const imgAlt = escapeAttr(altValue);
|
||||
innerHtml = `<img src="${imgSrc}" alt="${imgAlt}" />${innerHtml}`;
|
||||
}
|
||||
|
||||
return `<div class="${tokens.alignClass}"><a href="${escapeAttr(
|
||||
href,
|
||||
)}" class="${btnClasses}"${styleAttr}>${escapeHtml(label)}</a></div>`;
|
||||
)}" class="${btnClasses}"${styleAttr}>${innerHtml}</a></div>`;
|
||||
}
|
||||
|
||||
if (block.type === "video") {
|
||||
|
||||
Reference in New Issue
Block a user