Skip to content

MarkdownAura v1.4.0

Choose a tag to compare

@westsource westsource released this 08 Oct 11:37
· 36 commits to main since this release

MarkdownAura 1.4.0

Chinese and Japanese text writes emphasis the way it is read. 中文**"加粗"**中文 renders bold.
CommonMark refuses that shape — its flanking rules treat an ideograph exactly like a Latin letter, so a
** before a quote cannot open and the run after the closing quote cannot close — and Chinese and
Japanese have no word spacing, which makes the shape ordinary prose rather than an edge case. The
widening is deliberately narrow: it applies only where the neighbour CommonMark refuses is CJK and the
other side is punctuation, and it is additive by construction, so a run can only gain the emphasis its
author typed. Whitespace still blocks both directions (中文**加粗 **中文 keeps its **), a Latin
neighbour is untouched, and _ and *** are left to CommonMark. marktext, Typora and the VS Code
preview widen the same shape.

The renderer now has a measuring stick. cargo test runs the vendored CommonMark 0.31.2 (652
examples) and GFM 0.29 (672) suites through the real pipeline and compares the HTML: 578/652 and
574/672 today, with every difference listed in a baseline file and grouped by reason — raw HTML the
allow-list drops, a leading --- block read as frontmatter, pulldown nesting same-type emphasis where
cmark flattens it, and GFM's autolink extension (which pulldown-cmark does not implement at all: a bare
www.… or an unmarked email stays text, while <https://…> is core CommonMark and does link).
Compliance can only go up: an example that starts passing while it is still listed fails the test, and
one that starts failing while it is not listed fails it as well — so the next change to the allow-list
or the footnote pass cannot quietly move the renderer away from the reference. The fixtures are test
data under CC-BY-SA 4.0 and nothing of them ships.

A tab switch in the middle of a render no longer mixes two documents. Mermaid, d2 and graphviz cannot
be cancelled, but their writes can: every paint now takes the container's generation and abandons
itself whole when a newer paint has taken over — no cards, no language badges, no highlighting, no math
from the document you just left.

Tabs have a right-click menu. Close, close others, close to the right, close all, copy path, show in
explorer — acting on the tab you pointed at, and deliberately never activating it, because a right click
that also changed what you are reading would lose your place. Closing a tab to the left of the active one
keeps you on the same document; that path was reachable only from this menu, and without the fix it
switched the reader to a different file.

Smaller things. The About sheet's diagnostic payload no longer computes a log size nothing displays.
examples/showcase.md gained a display formula and the Chinese-emphasis paragraph. Both READMEs' Markdown
row now says what the renderer actually does — GFM's tables, task lists, strikethrough and footnotes, and
not its autolink extension.


中文按读法写强调,现在真的会成粗体。 中文**"加粗"**中文 渲染成粗体。CommonMark 拒绝这个形态——
它的 flanking 规则把汉字当成拉丁字母,于是引号前的 ** 不能开、引号后的 ** 不能闭;而中日文没有词间
空格,所以这不是边缘情况,是日常写法。放宽范围刻意收得很窄:只在"被拒的一侧是 CJK、另一侧是标点"时生效,
并且只增不减,一个标记只能拿回作者写的强调。空白仍然双向阻断(中文**加粗 **中文 保持字面),拉丁
邻居不动,_ 与 *** 交给 CommonMark。marktext、Typora 与 VS Code 预览放宽的是同一个形态。

渲染器第一次有了尺子。 cargo test 把内置的 CommonMark 0.31.2(652 例)与 GFM 0.29(672 例)跑过
真实管线并比对 HTML:今天 578/652、574/672,每一处差异都列在基线文件里并按原因归类——允许名单
丢弃的 raw HTML、开头 --- 被当 front matter、pulldown 把同类强调嵌套而 cmark 摊平、GFM autolink 扩展
(pulldown-cmark 根本没有实现:裸 www.… 与邮箱仍是文本,而 <https://…> 是 CommonMark 核心、本来就是
链接)。契约是单向的:某例不再失败却仍列在基线里 → 测试失败;某例开始失败却不在基线里 → 测试失败。所以
下一次改动允许名单或脚注逻辑,不可能悄悄让渲染器偏离参考实现。夹具是 CC-BY-SA 4.0 测试数据,不随包发布。

渲染途中切换标签,不再把两篇文档混在一起。 mermaid、d2、graphviz 无法取消,但它们的写入可以:
每次 paint 取容器的代际号,一旦被新的 paint 取代就整体放弃——不再有上一篇文章的卡片、语言徽标、着色或公式
落进新的预览里。

标签页有了右键菜单。 关闭 / 关闭其它 / 关闭右侧 / 全部关闭 / 复制路径 / 在资源管理器中显示;作用在你
右击的那个标签上,且从不激活它——一次右击顺手换掉你正在读的东西,等于丢掉阅读位置。关掉活动标签左侧
的标签后仍停在同一篇文档;这条路以前只有菜单能走到,而没有修正时它会把读者换到另一个文件。

零碎。 关于面板的诊断数据不再计算一个从不显示的日志体积。examples/showcase.md 增加了独立公式段与
中文强调一节。两份 README 的 Markdown 行改成渲染器真正做的事——GFM 的表格、任务清单、删除线与脚注,
不含 GFM autolink 扩展。