vitepress-plugin-field 0.6.0 → 0.8.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.
@@ -76,7 +76,7 @@ function parseFieldContent(content, info) {
76
76
  let tag;
77
77
  let rest;
78
78
  if (spaceIdx === -1) {
79
- tag = line.slice(1);
79
+ tag = line.slice(1).toLowerCase();
80
80
  rest = "";
81
81
  } else {
82
82
  tag = line.slice(1, spaceIdx).toLowerCase();
@@ -144,7 +144,7 @@ const fieldMarkdownPlugin = (md) => {
144
144
  createContainerSyntaxPlugin(md, "field", (tokens, idx, _, env) => {
145
145
  const { info, content } = tokens[idx];
146
146
  const { description, type, default: defaultValue, ...props } = parseFieldContent(content, info);
147
- return `<VPField${stringifyAttrs(props)}${isUndefined(type) ? "" : ` type="${type}"`}${isUndefined(defaultValue) ? "" : ` default-value="${defaultValue}"`}>${description ? md.render(description, env) : ""}</VPField>`;
147
+ return `<VPField${stringifyAttrs(props)}${isUndefined(type) ? "" : ` type="${md.utils.escapeHtml(type)}"`}${isUndefined(defaultValue) ? "" : ` default-value="${md.utils.escapeHtml(defaultValue)}"`}>${description ? md.render(description, env) : ""}</VPField>`;
148
148
  });
149
149
  };
150
150
  //#endregion
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vitepress-plugin-field",
3
3
  "type": "module",
4
- "version": "0.6.0",
4
+ "version": "0.8.0",
5
5
  "description": "Render structured API fields and properties documentation in your VitePress site.",
6
6
  "author": "pengzhanbo <q942450674@outlook.com> (https://github.com/pengzhanbo/)",
7
7
  "license": "MIT",
@@ -38,8 +38,8 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@pengzhanbo/utils": "^3.7.3",
41
- "vitepress-plugin-toolkit": "0.6.0",
42
- "vitepress-tuck": "0.6.0"
41
+ "vitepress-plugin-toolkit": "0.8.0",
42
+ "vitepress-tuck": "0.8.0"
43
43
  },
44
44
  "publishConfig": {
45
45
  "access": "public",