@astrojs/markdoc 0.12.0-beta.0 → 0.12.0

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,4 +1,34 @@
1
1
  import Markdoc from "@markdoc/markdoc";
2
+ const booleanAttributes = /* @__PURE__ */ new Set([
3
+ "allowfullscreen",
4
+ "async",
5
+ "autofocus",
6
+ "autoplay",
7
+ "checked",
8
+ "controls",
9
+ "default",
10
+ "defer",
11
+ "disabled",
12
+ "disablepictureinpicture",
13
+ "disableremoteplayback",
14
+ "download",
15
+ "formnovalidate",
16
+ "hidden",
17
+ "inert",
18
+ "ismap",
19
+ "itemscope",
20
+ "loop",
21
+ "multiple",
22
+ "muted",
23
+ "nomodule",
24
+ "novalidate",
25
+ "open",
26
+ "playsinline",
27
+ "readonly",
28
+ "required",
29
+ "reversed",
30
+ "selected"
31
+ ]);
2
32
  import { parseInlineCSSToReactLikeObject } from "../css/parse-inline-css-to-react.js";
3
33
  const htmlTag = {
4
34
  attributes: {
@@ -9,6 +39,11 @@ const htmlTag = {
9
39
  const { name, attrs: unsafeAttributes } = node.attributes;
10
40
  const children = node.transformChildren(config);
11
41
  const { style, ...safeAttributes } = unsafeAttributes;
42
+ for (const [key, value] of Object.entries(safeAttributes)) {
43
+ if (booleanAttributes.has(key)) {
44
+ safeAttributes[key] = value === "" || value === true || value === "true";
45
+ }
46
+ }
12
47
  if (typeof style === "string") {
13
48
  const styleObject = parseInlineCSSToReactLikeObject(style);
14
49
  safeAttributes.style = styleObject;
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@astrojs/markdoc",
3
3
  "description": "Add support for Markdoc in your Astro site",
4
- "version": "0.12.0-beta.0",
4
+ "version": "0.12.0",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
7
  "author": "withastro",
8
8
  "license": "MIT",
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "https://github.com/withastro/astro.git",
11
+ "url": "git+https://github.com/withastro/astro.git",
12
12
  "directory": "packages/integrations/markdoc"
13
13
  },
14
14
  "keywords": [
@@ -60,9 +60,9 @@
60
60
  "esbuild": "^0.21.5",
61
61
  "github-slugger": "^2.0.0",
62
62
  "htmlparser2": "^9.1.0",
63
- "@astrojs/internal-helpers": "0.4.1",
64
- "@astrojs/markdown-remark": "6.0.0-beta.2",
65
- "@astrojs/prism": "3.1.0"
63
+ "@astrojs/internal-helpers": "0.4.2",
64
+ "@astrojs/markdown-remark": "6.0.0",
65
+ "@astrojs/prism": "3.2.0"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "astro": "^5.0.0-alpha.0"
@@ -71,12 +71,12 @@
71
71
  "@types/markdown-it": "^14.1.2",
72
72
  "devalue": "^5.1.1",
73
73
  "linkedom": "^0.18.5",
74
- "vite": "6.0.0-beta.2",
75
- "astro": "5.0.0-beta.5",
74
+ "vite": "^6.0.1",
75
+ "astro": "5.0.0",
76
76
  "astro-scripts": "0.0.14"
77
77
  },
78
78
  "engines": {
79
- "node": "^18.17.1 || ^20.3.0 || >=21.0.0"
79
+ "node": "^18.17.1 || ^20.3.0 || >=22.0.0"
80
80
  },
81
81
  "publishConfig": {
82
82
  "provenance": true