vitepress-plugin-file-tree 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.
@@ -53,7 +53,7 @@ function fileTreeToCMDText(nodes, prefix = "") {
53
53
  * A filename wrapped in double asterisks is highlighted as a focused node.
54
54
  * The marker may be followed by a space and an inline comment.
55
55
  */
56
- const RE_FOCUS = /^\*\*(.*)\*\*(?:$|\s+)/;
56
+ const RE_FOCUS = /^\*\*(.*?)\*\*(?:$|\s+)/;
57
57
  /**
58
58
  * Parse a single node info string, extracting filename, comment, type, and
59
59
  * other metadata.
@@ -159,7 +159,7 @@ function parseContentWithContainer(content) {
159
159
  for (const line of lines) {
160
160
  const match = line.match(/^(\s*)-(.*)$/);
161
161
  if (!match) continue;
162
- const level = Math.floor((match[1].length - spaceLength) / 2);
162
+ const level = Math.max(0, Math.floor((match[1].length - spaceLength) / 2));
163
163
  const info = match[2].trim();
164
164
  while (stack.length > 0 && stack[stack.length - 1].level >= level) stack.pop();
165
165
  const parent = stack[stack.length - 1];
@@ -301,7 +301,7 @@ const fileTreeMarkdownPlugin = (md) => {
301
301
  type: "file"
302
302
  });
303
303
  const nodeType = children.length > 0 ? "folder" : type;
304
- const renderedComment = comment ? `<template #comment>${md.renderInline(comment.replaceAll("#", "#"))}</template>` : "";
304
+ const renderedComment = comment ? `<template #comment>${md.renderInline(comment)}</template>` : "";
305
305
  return `<VPFileTreeNode${stringifyAttrs({
306
306
  expanded: nodeType === "folder" ? expanded : false,
307
307
  focus,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vitepress-plugin-file-tree",
3
3
  "type": "module",
4
- "version": "0.6.0",
4
+ "version": "0.8.0",
5
5
  "description": "Render file tree structure in your VitePress site.",
6
6
  "author": "pengzhanbo <q942450674@outlook.com> (https://github.com/pengzhanbo/)",
7
7
  "license": "MIT",
@@ -39,8 +39,8 @@
39
39
  "dependencies": {
40
40
  "@pengzhanbo/utils": "^3.7.3",
41
41
  "@vueuse/core": "^14.3.0",
42
- "vitepress-plugin-toolkit": "0.6.0",
43
- "vitepress-tuck": "0.6.0"
42
+ "vitepress-plugin-toolkit": "0.8.0",
43
+ "vitepress-tuck": "0.8.0"
44
44
  },
45
45
  "publishConfig": {
46
46
  "access": "public",