게시물 HTML 블록 분리

This commit is contained in:
2026-06-26 15:23:19 +09:00
parent c77cf1032b
commit 8e3bf4a874
16 changed files with 233 additions and 101 deletions

View File

@@ -2800,14 +2800,14 @@ const appendImagesToActiveGallery = (images) => {
}
/**
* 현재 HTML 블록 값을 수정한다.
* @param {string} url - HTML 블록 값
* 현재 링크·iframe·HTML 블록 값을 수정한다.
* @param {string} url - 블록 값
* @returns {void}
*/
const updateActiveEmbedUrl = (url) => {
const block = activeBlockContext.value
if (!block || block.kind !== 'embed') {
if (!block || !['link', 'iframe', 'html'].includes(block.kind)) {
return
}
@@ -2819,12 +2819,7 @@ const updateActiveEmbedUrl = (url) => {
return
}
if (trimmed.includes('\n') || /^<iframe\b/i.test(trimmed)) {
replaceLineRange(block.startLine, block.endLine, [':::embed', trimmed, ':::'], false)
return
}
replaceLineRange(block.startLine, block.endLine, [trimmed], false)
replaceLineRange(block.startLine, block.endLine, [`:::${block.kind}`, trimmed, ':::'], false)
}
/**