@void/md 0.10.2 → 0.10.3

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.
package/README.md CHANGED
@@ -115,6 +115,7 @@ Full VitePress-parity feature set:
115
115
  - **Custom containers** — `:::tip`, `:::info`, `:::warning`, `:::danger`, `:::details`
116
116
  - **GitHub alerts** — `> [!NOTE]`, `> [!TIP]`, `> [!WARNING]`, `> [!IMPORTANT]`, `> [!CAUTION]`
117
117
  - **Emoji** — `:emoji_name:` shortcodes
118
+ - **Footnotes** — `text[^1]` refs with matching `[^1]: definition` blocks
118
119
  - **Attributes** — `{.class #id}` on elements via `markdown-it-attrs`
119
120
  - **Anchor links** — auto-generated heading anchors
120
121
  - **Table of contents** — `[[toc]]` directive
@@ -143,7 +144,7 @@ import '@void/md/theme.css'; // or theme-content.css
143
144
 
144
145
  ## Tests
145
146
 
146
- - `test/unit/compile.test.ts` — compilation pipeline: basic, frontmatter, title extraction, headings, Shiki, emoji, anchors
147
+ - `test/unit/compile.test.ts` — compilation pipeline: basic, frontmatter, title extraction, headings, Shiki, emoji, footnotes, anchors
147
148
  - `test/unit/extract-script.test.ts` — script extraction: island imports, client code, edge cases
148
149
  - `test/unit/plugins.test.ts` — markdown-it plugins: containers, GitHub alerts, links, images, line numbers, emoji, TOC
149
150
  - `test/unit/emit-vue.test.ts` — Vue component emission with and without islands
@@ -1,6 +1,7 @@
1
1
  import matter from "gray-matter";
2
2
  import MarkdownExit from "markdown-exit";
3
3
  import anchor from "markdown-it-anchor";
4
+ import footnote from "markdown-it-footnote";
4
5
  import { createJavaScriptRegexEngine } from "@shikijs/engine-javascript";
5
6
  import { transformerMetaHighlight, transformerNotationDiff, transformerNotationErrorLevel, transformerNotationFocus, transformerNotationHighlight } from "@shikijs/transformers";
6
7
  import attrs from "markdown-it-attrs";
@@ -304,6 +305,7 @@ async function createCompiler(options) {
304
305
  markdown.core.ruler.after("block", "stash_fence_info", stashFenceInfo);
305
306
  markdown.use(attrs);
306
307
  markdown.use(full);
308
+ markdown.use(footnote);
307
309
  markdown.use(anchor, { permalink: anchor.permalink.ariaHidden({ placement: "before" }) });
308
310
  markdown.use(tocPlugin);
309
311
  return markdown;
@@ -328,10 +330,9 @@ function extractHeadings(tokens) {
328
330
  async function compile(source, options) {
329
331
  const { data: frontmatter, content } = matter(source);
330
332
  const compiler = await getCompiler(options);
331
- const env = {};
332
- const headings = extractHeadings(compiler.parse(content, env));
333
+ const headings = extractHeadings(compiler.parse(content, {}));
333
334
  return {
334
- html: await compiler.renderAsync(content, env),
335
+ html: await compiler.renderAsync(content, {}),
335
336
  frontmatter,
336
337
  headings,
337
338
  title: frontmatter.title ?? headings.find((heading) => heading.depth === 1)?.text ?? ""
package/dist/plugin.mjs CHANGED
@@ -7,6 +7,7 @@ import { resolvePagesDir } from "void/pages";
7
7
  import matter from "gray-matter";
8
8
  import MarkdownExit from "markdown-exit";
9
9
  import anchor from "markdown-it-anchor";
10
+ import footnote from "markdown-it-footnote";
10
11
  //#region src/codegen/md-types.ts
11
12
  /**
12
13
  * Generate .void/md.d.ts content.
@@ -431,6 +432,7 @@ function getMetadataCompiler() {
431
432
  html: true,
432
433
  linkify: true
433
434
  });
435
+ markdown.use(footnote);
434
436
  markdown.use(anchor, { permalink: anchor.permalink.ariaHidden({ placement: "before" }) });
435
437
  metadataCompiler = markdown;
436
438
  return markdown;
@@ -650,7 +652,7 @@ export function useFrontmatter() { return useContext(FrontmatterContext) ?? {};
650
652
  const absPath = resolve(dirname(_id), imp.specifier);
651
653
  imp.islandId = normalizePath(relative(root, absPath)).replace(/\.[^.]+$/, "");
652
654
  }
653
- const { compile } = await import("./compile-D4HwBWGK.mjs");
655
+ const { compile } = await import("./compile-C9o0MYaR.mjs");
654
656
  const result = await compile(body, { shiki: options?.shiki });
655
657
  if (adapter === "vue") {
656
658
  if (islandImports.length > 0) return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@void/md",
3
- "version": "0.10.2",
3
+ "version": "0.10.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/voidzero-dev/void.git",
@@ -42,6 +42,7 @@
42
42
  "markdown-it-attrs": "^4.3.1",
43
43
  "markdown-it-container": "^4.0.0",
44
44
  "markdown-it-emoji": "^3.0.0",
45
+ "markdown-it-footnote": "^4.0.0",
45
46
  "pathe": "^2.0.3",
46
47
  "shiki": "^4.0.2",
47
48
  "tinyglobby": "^0.2.16"
@@ -51,11 +52,11 @@
51
52
  "vite": "npm:@voidzero-dev/vite-plus-core@0.1.20",
52
53
  "vite-plus": "^0.1.20",
53
54
  "vue": "^3.5.34",
54
- "void": "0.10.2"
55
+ "void": "0.10.3"
55
56
  },
56
57
  "peerDependencies": {
57
58
  "vite": "^8.0.0",
58
- "void": "0.10.2"
59
+ "void": "0.10.3"
59
60
  },
60
61
  "scripts": {
61
62
  "build": "vp pack",