Skip to content

MarkdownAura v1.3.0

Choose a tag to compare

@westsource westsource released this 08 Oct 03:14
· 46 commits to main since this release

MarkdownAura 1.3.0

The preview now renders the things a reader notices are missing. Fenced code is highlighted per
language (Prism, MIT: ~50 grammars in one lazily-loaded chunk, so a document without a code fence pays
nothing for it), footnotes collect into one numbered section at the end with an ↩ back to every
citation, and math typesets through KaTeX (MIT) — $…$, $$…$$, chemistry included. Math is a setting
and it is off by default, because turning it on takes $ away from ordinary text and a document
that talks about prices should keep talking about prices. Those two packages are the only dependencies
this release adds.

An unknown language is not an error, and neither is a failed formula. A fence naming a language
nothing ships stays plain monospace text — no badge, no warning, nothing in the status bar. A formula
that will not parse keeps its place on the line with KaTeX's own marker and the reason in its tooltip,
because swapping an inline formula for a block-level error card breaks the sentence it sits in.

Diagram cards got the parts that were missing. A card is opened the moment the fence is known —
head, badge, zoom/copy, rendering… in a body that reserves its height — and filled when the
engine answers, so a slow d2 block no longer pushes the page around twice. A card that fails keeps its
identity: data-diagram and the source stay put, so the outline, the viewer's target and split-view
scroll sync still find it; only zoom goes, because there is nothing to show. A rendered card is an
image to assistive tech (role="img", named from the SVG's own <title>/<desc> or from the
caption), and an engine SVG that has pixels but no viewBox gets one — without it max-width: 100%
clips the drawing instead of scaling it (measured: a 900×120 SVG inside a 698px body rendered its box
at 674px while the inner <rect> stayed at 900px).

Three style rules that matched nothing now work, and one row is simpler. li.task and
.footnotes had been in prose.css from the start while the renderer emits a bare
<li><input type=checkbox> and a .footnote-definition — so task checkboxes kept their bullet marker
and the notes rendered unstyled with no way back. The table's width: 100% never reached the grid
either (an anonymous table box does not take it); it is max-content now. And the About sheet's log
row is one button: open. The files in that folder are the report, and the crash report a panic
writes never went through the two buttons that were removed with it.

1.3.0 also carries everything 1.2.0 shipped — the crash-evidence log, in-place editing, and the
three bundled diagram engines.


MarkdownAura 1.3.0

预览现在会渲染读者一眼就能看出缺失的东西。 代码围栏按语言着色(Prism,MIT:约 50 个语法放在一个懒加载
chunk 里,没有代码围栏的文档一分钱都不花),脚注收拢为文末一个编号区块、每条都有 ↩ 跳回引用处,公式由
KaTeX(MIT)排版——$…$、$$…$$,含化学式。数学是一项设置,且默认关闭:打开之后 $ 就不再是普通
字符,而一篇在讲价格的文档应该继续讲价格。本版只新增这两个依赖。

不认识的语言不是错误,公式渲染失败也不是。 围栏写了没随包的语言就保持纯文本——没有徽章、没有警告、
状态栏也不提。写坏的公式留在原处,带 KaTeX 自己的错误标记、原因放在悬停提示里;把行内公式换成块级错误卡片
会把所在的那句话拆断。

图表卡片补齐了缺的那几块。 围栏一出现卡片就开好——头部、引擎徽章、zoom/copy、正文里先写「渲染中」
并预留高度——等引擎给出结果再填入,慢的 d2 块不再让页面被推两次。渲染失败的卡片保留身份:data-diagram
与源码都还在,所以大纲、查看器目标、分栏同步仍然找得到它,只是没有 zoom(没有东西可看)。渲染好的卡片对
辅助技术是一张图(role="img",名字取自 SVG 自己的 <title>/<desc>,否则用卡片标题),而只有像素、没有
viewBox 的引擎 SVG 会被补上一个——没有它,max-width: 100% 是把图裁掉而不是缩小(实测:900×120 的
SVG 放进 698px 宽的容器,盒子缩到 674px,内部 <rect> 仍是 900px)。

三条从未匹配到任何东西的样式规则修好了,一行也变简单了。 li.task 与 .footnotes 从第一天就在
prose.css 里,而渲染器产出的是裸 <li><input type=checkbox> 与 .footnote-definition——于是任务清单的
复选框一直带着项目符号、脚注一直没有样式也没有回跳。表格的 width: 100% 同样从未作用到网格上(匿名 table
盒不接这个值),现在是 max-content。另外「关于」面板的日志行只剩一颗按钮:打开——那个文件夹里的文件本身
就是报告,而 panic 时自动写的崩溃报告从来不经过随之移除的那两颗按钮。

1.3.0 也包含 1.2.0 的全部内容——崩溃证据日志、按需就地编辑,以及三个内置的图表引擎。