Files
thu-maic--openmaic/packages/@openmaic/importer/test/textSerializer.emptyParagraph.test.ts
wehub-resource-sync c48612c494
CI / E2E Tests (push) Has been cancelled
CI / Lint, Typecheck & Unit Tests (push) Has been cancelled
Docs Build / Build docs site (push) Has been cancelled
Publish @openmaic packages / Build, validate & publish (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:03:23 +08:00

24 lines
1.0 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 { describe, it, expect } from 'vitest';
import { renderTxBodyHtml } from './helpers';
/**
* 回归(auto-fix.md 坑表):空段(占位空行)的填充与高度。
*
* 现象①(a2m):用 `<p><br/></p>` 撑高度的空段,在 ProseMirror 里 hard_break 结尾
* 会再补一个 trailingBreak → `<br><br>` = 2 行,累积把下方图标/正文整体压下去错位。
* 修复:空段填充改用 `&nbsp;`raw-HTML 与 ProseMirror 两端都恰好 1 行)。
* 现象②:空 `<p>` 高度为 0(没有内联盒),需要按 endParaRPr 的字号撑出空行高度。
*/
describe('textSerializer · 空段填充', () => {
const html = renderTxBodyHtml(`<a:p><a:endParaRPr sz="3600"/></a:p>`);
it('空段用 &nbsp; 填充,而不是 <br/>(避免 a2m 里被加倍成两行)', () => {
expect(html).toContain('&nbsp;');
expect(html).not.toContain('<br');
});
it('空段按 endParaRPr 字号撑出行高(sz=3600 → 36pt', () => {
expect(html).toContain('font-size: 36pt');
});
});