콜아웃 제목과 기본 아이콘 정리

This commit is contained in:
2026-06-04 15:40:43 +09:00
parent 67fbba3814
commit 94226423c7
17 changed files with 170 additions and 62 deletions

View File

@@ -1,3 +1,5 @@
import { buildCalloutOpenerLine } from './markdown-callout.js'
const BLANK_PARAGRAPH_MARKER = '<!--sori:blank-paragraph-->'
const blockSpacingTypes = new Set(['list'])
@@ -59,13 +61,20 @@ const serializeLegacyBlock = (block = {}, index = 0, total = 1) => {
}
if (type === 'callout') {
const emoji = block.calloutEmojiEnabled === false
? 'none'
: (block.calloutEmoji || '💡')
const background = block.calloutBackground || 'blue'
return text
? { type, value: `:::callout emoji=${emoji} bg=${background}\n${text}\n:::` }
? {
type,
value: [
buildCalloutOpenerLine({
calloutEmojiEnabled: block.calloutEmojiEnabled,
calloutEmoji: block.calloutEmoji,
calloutBackground: block.calloutBackground,
title: block.title
}),
text,
':::'
].join('\n')
}
: null
}