@takazudo/zfb 2.5.0 → 2.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/package.json +6 -6
package/CHANGELOG.md CHANGED
@@ -4,6 +4,42 @@
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ### Behavior changes
8
+
9
+ **Transcluded files now honour `markdown.gfm`** (#2390):
10
+
11
+ Files pulled in by `:::include{file="./snippet.md"}` were parsed with **every GFM construct off**, no matter what `markdown.gfm` said — no tables, strikethrough, task lists, footnotes, or autolink literals.
12
+
13
+ The symptom was that identical markdown rendered differently depending on where it was written: a pipe table in the page became a table, the byte-identical table in an included file stayed literal text. Since 2.5.0 turned `autolinkLiteral` on by default, bare URLs in included files also silently stopped autolinking.
14
+
15
+ Included files now inherit the project's resolved `markdown.gfm` configuration and render the same as the equivalent content written inline.
16
+
17
+ **This changes rendered output for existing sites.** If a project transcludes GFM-flavoured content and was (knowingly or not) relying on it staying literal, that content now renders as GFM. Set the relevant `markdown.gfm.*` flags to `false` to keep the old output. A project that never enabled GFM is unaffected.
18
+
19
+ The same hardcoded construct set was fixed at a second parse site — the body of a directive written **without** blank lines, and the page prose sitting between two such runs (`DirectiveRegistry::reparse_block`). In practice that one is **not** expected to change rendered output: the re-parse is only reached for content the main parse left as a single plain text run, and the main parse now shares the same constructs. It is fixed to keep the two parse sites in lockstep rather than to change behaviour.
20
+
21
+ The divergence #2390 left open — math constructs staying off at both secondary parse sites — is closed by #2397 below.
22
+
23
+ **Math in transcluded files now matches the surrounding page** (#2397):
24
+
25
+ This finishes what #2390 started: content reached through a secondary parse site now renders the same as the equivalent content written inline, on **each** path separately.
26
+
27
+ zfb parses markdown with a different construct set per path. The HTML serializer keeps math off, so `$$…$$` is literal text; the MDX/JSX path turns it on, because the emitter has dedicated arms for math nodes. Both secondary parse sites — transclusion, and the re-parse of a directive body written without blank lines — hardcoded the HTML set, so they diverged from the top level whenever a page was compiled to JSX.
28
+
29
+ For MDX/JSX pages that was not a rendering nuance. A single `$$…$$` in an included file leaked LaTeX as bare `{…}` expression containers, esbuild rejected the module, and the bundler's defensive skip degraded the **entire page** to `<pre data-zfb-content-fallback>`. Math in included files is now safe.
30
+
31
+ **HTML-path output is unchanged.** Math stays off there, exactly as before — turning it on would change rendered output for every existing project and would pull in markdown-rs's single-dollar behaviour, where a literal `$` in prose becomes math. The asymmetry being removed is between transcluded and inline content, not between the two paths.
32
+
33
+ The directive re-parse site was brought into lockstep the same way. As with #2390's GFM change, it is **not** expected to alter rendered output: that re-parse is only reached for content the main parse left as a single plain text run, and math rich enough to render differently is tokenised by the main parse first.
34
+
35
+ **CJK-friendly emphasis and hard breaks now apply inside transcluded files and directive bodies** (#2398):
36
+
37
+ `CjkFriendlyPlugin` and `HardBreaksPlugin` are visitors in the pipeline's own mdast chain, so they never saw a subtree parsed later by `TranscludePlugin` or `DirectiveRegistry::reparse_block` — the same class of gap #2390 and #2397 fixed for GFM and math constructs. On a CJK site with `markdown.cjkFriendly` on (the default), CJK emphasis flanking was corrected in the page body but not inside `:::include`d snippets or collapsed directive bodies; with `markdown.hardBreaks` on, soft line breaks became `<br>` in the page but not in that same content.
38
+
39
+ Both passes now run at both secondary parse sites, gated on the project's own `cjkFriendly` / `hardBreaks` settings rather than on any GFM construct. **This changes rendered output for existing sites** that transclude CJK-flanked emphasis markup, or newline-sensitive prose, and were relying on the secondary-parse gap to leave it untouched — set `cjkFriendly: false` / `hardBreaks: false` to keep the old output; a project that never enabled either is unaffected.
40
+
41
+ **One deliberate asymmetry:** `HardBreaksPlugin` is gated by where the re-parsed content *lands*, not by which site produced it. Content that ends up among the children of an MDX JSX element — a collapsed directive body, prose between nested directive runs, or an `:::include` written inside a literal `<Note>…</Note>` — gets hard breaks on the JSX-emit path only. On the HTML path such an element renders through a lossy catch-all that stringifies `Break` nodes to an **empty string**, so applying the plugin there would silently delete the author's newlines instead of turning them into `<br>` — a regression, not parity. HTML-path output for that content is unchanged. Top-level transcluded content is unaffected by the gate and gets `<br>` on both paths. `CjkFriendlyPlugin` has no such asymmetry and applies on both paths at both sites.
42
+
7
43
  ### Build compatibility
8
44
 
9
45
  **Explicit workspace-root alias claims** (#1883):
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takazudo/zfb",
3
- "version": "2.5.0",
3
+ "version": "2.5.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Rust-built static-site engine for Astro and Next.js users — millisecond rebuilds, single binary. SDK with islands, content collections, pagination, and config helpers.",
@@ -74,11 +74,11 @@
74
74
  "LICENSE"
75
75
  ],
76
76
  "optionalDependencies": {
77
- "@takazudo/zfb-darwin-arm64": "2.5.0",
78
- "@takazudo/zfb-darwin-x64": "2.5.0",
79
- "@takazudo/zfb-linux-arm64-gnu": "2.5.0",
80
- "@takazudo/zfb-linux-x64-gnu": "2.5.0",
81
- "@takazudo/zfb-win32-x64-msvc": "2.5.0"
77
+ "@takazudo/zfb-darwin-arm64": "2.5.2",
78
+ "@takazudo/zfb-darwin-x64": "2.5.2",
79
+ "@takazudo/zfb-linux-arm64-gnu": "2.5.2",
80
+ "@takazudo/zfb-linux-x64-gnu": "2.5.2",
81
+ "@takazudo/zfb-win32-x64-msvc": "2.5.2"
82
82
  },
83
83
  "publishConfig": {
84
84
  "access": "public"