Files
BoosAPI/desktop/libs/markstream-vue/test/blockquote-regressions.test.ts
boos e0a5f57793 feat(desktop): embed BoosAPI Desktop client as a subproject
Vendor the rebranded BoosAPI Desktop client (Tauri + Vue) into metapi as
a monorepo subdirectory under desktop/. Source only — node_modules,
dist, Cargo target and the upstream .git history are excluded.

desktop/ keeps its own independent Cargo workspace (desktop/src-tauri
with crates/*); it is not part of the backend boosapi crate, so a
`cargo check` at the metapi root still compiles only the backend. Build
the desktop app from desktop/src-tauri per desktop/README.md.

Note: app icons are still placeholder assets pending the final BoosAPI
logo. The updater signing keys live outside the repo and are not
included.
2026-06-22 11:32:57 +08:00

29 lines
1.2 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { getMarkdown, parseMarkdownToStructure } from 'stream-markdown-parser'
import { describe, expect, it } from 'vitest'
describe('blockquote regressions', () => {
const md = getMarkdown('blockquote-regressions')
it('keeps tables nested inside blockquotes', () => {
const markdown = `> PCB描述如下:
>
> | 料号 | 品名 | 规格 |
> | -- | -- | -- |
> | 120300-5420-01 | PCB | 临时物料-枪机项目-型号:507AA_SENSOR_V10-单板尺寸:27.33*39.22*1.0mm-4层-FR4-黑油-拼板-4*4-拼版尺寸:129.32*162.88*1.0mm-0SP-TG>=150℃ MOT>=130℃-环保测试(RoHS2.0)-五株 [1]`
const nodes = parseMarkdownToStructure(markdown, md)
expect(nodes.length).toBe(1)
const blockquote: any = nodes[0]
expect(blockquote.type).toBe('blockquote')
const hasParagraph = blockquote.children?.some((child: any) => child.type === 'paragraph')
expect(hasParagraph).toBe(true)
const tableNode: any = blockquote.children?.find((child: any) => child.type === 'table')
expect(tableNode).toBeTruthy()
expect(tableNode.rows?.[0]?.cells?.length).toBe(3)
const firstCellText = tableNode.rows?.[0]?.cells?.[0]?.children?.[0]?.content || ''
expect(firstCellText).toContain('120300-5420-01')
})
})