@astrojs/markdown-remark 7.1.0 → 7.1.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.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import Slugger from "github-slugger";
|
|
2
2
|
import { visit } from "unist-util-visit";
|
|
3
|
+
import { FORBIDDEN_PATH_KEYS } from "@astrojs/internal-helpers/object";
|
|
3
4
|
const rawNodeTypes = /* @__PURE__ */ new Set(["text", "raw", "mdxTextExpression"]);
|
|
4
5
|
const codeTagNames = /* @__PURE__ */ new Set(["code", "pre"]);
|
|
5
6
|
function rehypeHeadingIds() {
|
|
@@ -78,7 +79,9 @@ function getMdxFrontmatterVariablePath(node) {
|
|
|
78
79
|
function getMdxFrontmatterVariableValue(frontmatter, path) {
|
|
79
80
|
let value = frontmatter;
|
|
80
81
|
for (const key of path) {
|
|
81
|
-
if (!value
|
|
82
|
+
if (FORBIDDEN_PATH_KEYS.has(key) || !value || typeof value !== "object" || !Object.hasOwn(value, key)) {
|
|
83
|
+
return void 0;
|
|
84
|
+
}
|
|
82
85
|
value = value[key];
|
|
83
86
|
}
|
|
84
87
|
return value;
|
package/dist/rehype-prism.js
CHANGED
|
@@ -4,11 +4,9 @@ const rehypePrism = (excludeLangs) => {
|
|
|
4
4
|
return async (tree) => {
|
|
5
5
|
await highlightCodeBlocks(
|
|
6
6
|
tree,
|
|
7
|
-
(code, language) => {
|
|
8
|
-
let { html, classLanguage } = runHighlighterWithAstro(language, code);
|
|
9
|
-
return
|
|
10
|
-
`<pre class="${classLanguage}" data-language="${language}"><code class="${classLanguage}">${html}</code></pre>`
|
|
11
|
-
);
|
|
7
|
+
async (code, language) => {
|
|
8
|
+
let { html, classLanguage } = await runHighlighterWithAstro(language, code);
|
|
9
|
+
return `<pre class="${classLanguage}" data-language="${language}"><code class="${classLanguage}">${html}</code></pre>`;
|
|
12
10
|
},
|
|
13
11
|
excludeLangs
|
|
14
12
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrojs/markdown-remark",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "withastro",
|
|
6
6
|
"license": "MIT",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"unist-util-visit": "^5.1.0",
|
|
50
50
|
"unist-util-visit-parents": "^6.0.2",
|
|
51
51
|
"vfile": "^6.0.3",
|
|
52
|
-
"@astrojs/internal-helpers": "0.
|
|
53
|
-
"@astrojs/prism": "4.0.
|
|
52
|
+
"@astrojs/internal-helpers": "0.9.1",
|
|
53
|
+
"@astrojs/prism": "4.0.2"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/estree": "^1.0.8",
|
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
},
|
|
68
68
|
"scripts": {
|
|
69
69
|
"prepublish": "pnpm build",
|
|
70
|
-
"build": "astro-scripts build \"src/**/*.ts\" && tsc -
|
|
70
|
+
"build": "astro-scripts build \"src/**/*.ts\" && tsc -b",
|
|
71
71
|
"build:ci": "astro-scripts build \"src/**/*.ts\"",
|
|
72
72
|
"dev": "astro-scripts dev \"src/**/*.ts\"",
|
|
73
|
-
"test": "astro-scripts test \"test/**/*.test.
|
|
73
|
+
"test": "astro-scripts test \"test/**/*.test.ts\""
|
|
74
74
|
}
|
|
75
75
|
}
|