관리자 인용 컨텍스트 파서 통합
This commit is contained in:
33
tests/markdown-block-context.test.js
Normal file
33
tests/markdown-block-context.test.js
Normal 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
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user