라이브 인용문 아래 이동 수정

This commit is contained in:
2026-06-09 14:30:37 +09:00
parent 34b2d0a4c0
commit 080be1ef15
9 changed files with 33 additions and 8 deletions

View File

@@ -1829,20 +1829,30 @@ const onPreviewAppendParagraph = () => {
/**
* 라이브 모드에서 지정 줄 아래에 마크다운 줄을 삽입한다.
* @param {{ afterLine: number, lines: string[] }} payload - 삽입 위치·줄
* @param {{ afterLine: number, lines: string[], focusLine?: number }} payload - 삽입 위치·줄
* @returns {void}
*/
const onPreviewInsertAfterLine = ({ afterLine, lines }) => {
const onPreviewInsertAfterLine = ({ afterLine, lines, focusLine }) => {
if (typeof afterLine !== 'number' || !Array.isArray(lines)) {
return
}
const sourceLines = (markdownValue.value ?? '').split('\n')
const nextFocusLine = typeof focusLine === 'number'
? focusLine
: afterLine + 1
markdownValue.value = [
...sourceLines.slice(0, afterLine + 1),
...lines,
...sourceLines.slice(afterLine + 1)
].join('\n')
activeLogicalLineIndex.value = nextFocusLine
nextTick(() => {
previewRendererRef.value?.focusEditableAtLine(nextFocusLine, 0, 'start')
})
}
/**

View File

@@ -2970,6 +2970,7 @@ onBeforeUnmount(() => {
@insert-below="onQuoteBlockInsertBelow(block, $event)"
@delete-line="onDeleteLine"
@merge-with-previous="onQuoteBlockConvertToParagraph(block, $event)"
@focus-line="emitEditorFocusedLine"
/>
</ProseBlockquote>
<ProseBlockquote