feat: better markdown

This commit is contained in:
Brooklyn Nicholson 2026-04-11 17:15:36 -05:00
parent 9ccb490cf3
commit 24a498eb90
3 changed files with 407 additions and 74 deletions

View file

@ -1,6 +1,6 @@
import { describe, expect, it } from 'vitest'
import { fmtK, isToolTrailResultLine, lastCotTrailIndex, sameToolTrailGroup } from '../lib/text.js'
import { estimateRows, fmtK, isToolTrailResultLine, lastCotTrailIndex, sameToolTrailGroup } from '../lib/text.js'
describe('isToolTrailResultLine', () => {
it('detects completion markers', () => {
@ -49,3 +49,17 @@ describe('fmtK', () => {
expect(fmtK(1_000_000_000)).toBe('1B')
})
})
describe('estimateRows', () => {
it('handles tilde code fences', () => {
const md = ['~~~markdown', '# heading', '~~~'].join('\n')
expect(estimateRows(md, 40)).toBeGreaterThanOrEqual(2)
})
it('handles checklist bullets as list rows', () => {
const md = ['- [x] done', '- [ ] todo'].join('\n')
expect(estimateRows(md, 40)).toBe(2)
})
})