contentbase 0.4.2 → 0.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentbase",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "repository": "https://github.com/soederpop/contentbase",
5
5
  "website": "https://contentbase.soederpop.com",
6
6
  "type": "module",
@@ -24,6 +24,7 @@
24
24
  "luca": ">= 3.0.2",
25
25
  "gray-matter": "^4.0.3",
26
26
  "js-yaml": "^4.1.0",
27
+ "mdast-util-gfm": "^3.1.0",
27
28
  "mdast-util-mdxjs-esm": "^2.0.1",
28
29
  "mdast-util-to-markdown": "^2.1.2",
29
30
  "mdast-util-to-string": "^4.0.0",
@@ -1,9 +1,15 @@
1
1
  import { toMarkdown } from "mdast-util-to-markdown";
2
+ import { gfmToMarkdown } from "mdast-util-gfm";
2
3
  import type { Root } from "mdast";
3
4
 
4
5
  /**
5
6
  * Convert an MDAST tree back to a markdown string.
7
+ *
8
+ * The parse pipeline uses remark-gfm, so ASTs routinely contain GFM nodes
9
+ * (tables, strikethrough, task lists, footnotes). The serializer must carry
10
+ * the matching extensions or toMarkdown throws "Cannot handle unknown node"
11
+ * on any GFM content.
6
12
  */
7
13
  export function stringifyAst(ast: Root): string {
8
- return toMarkdown(ast);
14
+ return toMarkdown(ast, { extensions: [gfmToMarkdown()] });
9
15
  }