@astrojs/markdoc 0.11.4 → 1.0.0-alpha.1

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.
@@ -2,14 +2,22 @@ import { createShikiHighlighter } from "@astrojs/markdown-remark";
2
2
  import Markdoc from "@markdoc/markdoc";
3
3
  import { unescapeHTML } from "astro/runtime/server/index.js";
4
4
  async function shiki(config) {
5
- const highlighter = await createShikiHighlighter(config);
5
+ const highlighter = await createShikiHighlighter({
6
+ langs: config?.langs,
7
+ theme: config?.theme,
8
+ themes: config?.themes
9
+ });
6
10
  return {
7
11
  nodes: {
8
12
  fence: {
9
13
  attributes: Markdoc.nodes.fence.attributes,
10
14
  async transform({ attributes }) {
11
15
  const lang = typeof attributes.language === "string" ? attributes.language : "plaintext";
12
- const html = await highlighter.highlight(attributes.content, lang);
16
+ const html = await highlighter.codeToHtml(attributes.content, lang, {
17
+ wrap: config?.wrap,
18
+ defaultColor: config?.defaultColor,
19
+ transformers: config?.transformers
20
+ });
13
21
  return unescapeHTML(html);
14
22
  }
15
23
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@astrojs/markdoc",
3
3
  "description": "Add support for Markdoc in your Astro site",
4
- "version": "0.11.4",
4
+ "version": "1.0.0-alpha.1",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
7
  "author": "withastro",
@@ -62,18 +62,18 @@
62
62
  "gray-matter": "^4.0.3",
63
63
  "htmlparser2": "^9.1.0",
64
64
  "@astrojs/internal-helpers": "0.4.1",
65
- "@astrojs/markdown-remark": "5.2.0",
65
+ "@astrojs/markdown-remark": "6.0.0-alpha.1",
66
66
  "@astrojs/prism": "3.1.0"
67
67
  },
68
68
  "peerDependencies": {
69
- "astro": "^3.0.0 || ^4.0.0"
69
+ "astro": "^5.0.0-alpha.0"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@types/markdown-it": "^14.1.2",
73
73
  "devalue": "^5.0.0",
74
74
  "linkedom": "^0.18.4",
75
75
  "vite": "^5.4.2",
76
- "astro": "4.14.6",
76
+ "astro": "5.0.0-alpha.3",
77
77
  "astro-scripts": "0.0.14"
78
78
  },
79
79
  "engines": {