관리자 인용 컨텍스트 파서 통합

This commit is contained in:
2026-07-24 14:58:21 +09:00
parent 7481773085
commit 578ee889ee
6 changed files with 47 additions and 53 deletions

View File

@@ -0,0 +1,33 @@
import assert from 'node:assert/strict'
import test from 'node:test'
import { resolveActiveBlockContext } from '../lib/markdown-block-context.js'
test('인용 옵션이 있는 블록 컨텍스트를 공통 인용 파서로 판별한다', () => {
assert.deepEqual(resolveActiveBlockContext([
'> {bg=purple}',
'> 첫 줄',
'> 둘째 줄',
'',
'다음 문단'
].join('\n'), 1), {
kind: 'quote',
startLine: 0,
endLine: 2,
quoteBackground: 'purple',
hasQuoteOptions: true
})
})
test('인용 옵션이 없는 블록 컨텍스트는 기본 배경을 사용한다', () => {
assert.deepEqual(resolveActiveBlockContext([
'이전 문단',
'> 첫 줄',
'> 둘째 줄'
].join('\n'), 2), {
kind: 'quote',
startLine: 1,
endLine: 2,
quoteBackground: 'gray',
hasQuoteOptions: false
})
})