release: 发布 v0.5.0
新增共享 Preview Engine,统一 Web 连续预览、快速分页、Playwright PDF 与 Electron PDF;实现稳定前缀复用和修改位置后的增量分页,保留媒体块按文档顺序串行回填与单次重排。 完善跨端链接与桌面文档工作流:Web 受控处理锚点和 HTTP/HTTPS 外链;Desktop 支持本地路径、file URI、系统协议、多窗口、同文件单例、Markdown 当前或新窗口打开,以及聚焦时外部文件变化提示。 统一四套内置主题名称并默认使用 Typora Github;修复连续预览双滚动条、ECharts 尺寸、PDF 本地链接、围栏代码块 Typora DOM 与重复行内样式;桌面发行链强制完整重建内嵌 Web,避免安装包携带陈旧资源。 发布 Web/Compose 与 Windows NSIS/ZIP:镜像 yixiong/md-to-pdf:v0.5.0 已健康部署;NSIS SHA-256 为 60992D1FDCA513F46346C78478537EB4159D8C0E76B41ECF3CDC25BE77707D92,ZIP SHA-256 为 D74F82293FB67126E583546CBA894569EFC9A0B1B6343FAC648CCC95F1D188D8,本机安装版已升级至 v0.5.0。 验证:全项目 238 项测试通过,类型检查、生产构建和 git diff --check 通过;Web 快速/连续/精确预览、Compose、Desktop 多窗口、窗口状态、文件关联、链接与代码块均完成真实环境验收。
This commit is contained in:
@@ -37,6 +37,26 @@ const answer = 42;
|
||||
);
|
||||
});
|
||||
|
||||
it("为围栏代码块输出 Typora 主题兼容容器", () => {
|
||||
const result = renderMarkdown(`
|
||||
\`\`\`
|
||||
无语言代码块
|
||||
\`\`\`
|
||||
|
||||
\`\`\`ts
|
||||
const answer = 42;
|
||||
\`\`\`
|
||||
`);
|
||||
|
||||
expect(result.bodyHtml).toContain(
|
||||
'<pre class="md-fences"><code>无语言代码块\n</code></pre>'
|
||||
);
|
||||
expect(result.bodyHtml).toContain(
|
||||
'<pre class="md-fences" lang="ts"><code class="language-ts">'
|
||||
);
|
||||
expect(result.bodyHtml).toContain("hljs-keyword");
|
||||
});
|
||||
|
||||
it("保留 Markdown 表格的列对齐语义", () => {
|
||||
const result = renderMarkdown(`
|
||||
| 左对齐 | 居中 | 右对齐 |
|
||||
@@ -211,6 +231,38 @@ option:
|
||||
expect(result.bodyHtml).toContain("<script>");
|
||||
});
|
||||
|
||||
it("保留平台适配器可处理的文档链接", () => {
|
||||
const result = renderMarkdown(`
|
||||
[锚点](#章节一)
|
||||
[网络](https://example.com/a)
|
||||
[协议相对](//example.com/a)
|
||||
[邮件](mailto:a@example.com)
|
||||
[电话](tel:+8612345)
|
||||
[上级目录](../docs/a.md)
|
||||
[绝对路径](C:/docs/a.md)
|
||||
[本地 URI](<file:///C:/docs/a.md>)
|
||||
[自定义协议](obsidian://open?vault=x)
|
||||
`);
|
||||
|
||||
expect(result.bodyHtml).toContain('href="#%E7%AB%A0%E8%8A%82%E4%B8%80"');
|
||||
expect(result.bodyHtml).toContain(
|
||||
'href="https://example.com/a"'
|
||||
);
|
||||
expect(result.bodyHtml).toContain('href="//example.com/a"');
|
||||
expect(result.bodyHtml).toContain(
|
||||
'href="mailto:a@example.com"'
|
||||
);
|
||||
expect(result.bodyHtml).toContain('href="tel:+8612345"');
|
||||
expect(result.bodyHtml).toContain('href="../docs/a.md"');
|
||||
expect(result.bodyHtml).toContain('href="C:/docs/a.md"');
|
||||
expect(result.bodyHtml).toContain(
|
||||
'href="file:///C:/docs/a.md"'
|
||||
);
|
||||
expect(result.bodyHtml).toContain(
|
||||
'href="obsidian://open?vault=x"'
|
||||
);
|
||||
});
|
||||
|
||||
it("提取图片引用并使用受控资源地址替换", () => {
|
||||
const source =
|
||||
"\n\n";
|
||||
|
||||
Reference in New Issue
Block a user