vuepress-plugin-md-power 1.0.0-rc.98 → 1.0.0-rc.99

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.
@@ -123,7 +123,7 @@ onUnmounted(() => {
123
123
  transition: color var(--t-color);
124
124
  }
125
125
 
126
- .file-tree-item .tree-node.file .name.focus {
126
+ .file-tree-item .tree-node .name.focus {
127
127
  font-weight: bold;
128
128
  color: var(--vp-c-brand-1);
129
129
  transition: color var(--t-color);
package/lib/node/index.js CHANGED
@@ -1159,11 +1159,13 @@ async function fileTreePlugin(app, md) {
1159
1159
  const validate = (info) => info.trim().startsWith(type);
1160
1160
  const render = (tokens, idx) => {
1161
1161
  if (tokens[idx].nesting === 1) {
1162
+ const hasRes = [];
1162
1163
  for (let i = idx + 1; !(tokens[i].nesting === -1 && tokens[i].type === closeType); ++i) {
1163
1164
  const token = tokens[i];
1164
1165
  if (token.type === "list_item_open") {
1165
1166
  const result = resolveTreeNodeInfo(tokens, token, i);
1166
1167
  if (result) {
1168
+ hasRes.push(token.level);
1167
1169
  const [info2, inline] = result;
1168
1170
  const { filename, type: type2, expanded, empty } = info2;
1169
1171
  const icon = type2 === "file" ? getFileIcon(filename) : folderIcon;
@@ -1174,10 +1176,14 @@ async function fileTreePlugin(app, md) {
1174
1176
  token.attrSet(":empty", empty ? "true" : "false");
1175
1177
  updateInlineToken(inline, info2, `${classPrefix}${icon.name}`);
1176
1178
  addIcon(icon);
1179
+ } else {
1180
+ hasRes.push(-1);
1177
1181
  }
1178
1182
  } else if (token.type === "list_item_close") {
1179
- token.type = itemClose;
1180
- token.tag = componentName;
1183
+ if (token.level === hasRes.pop()) {
1184
+ token.type = itemClose;
1185
+ token.tag = componentName;
1186
+ }
1181
1187
  }
1182
1188
  }
1183
1189
  const info = tokens[idx].info.trim();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vuepress-plugin-md-power",
3
3
  "type": "module",
4
- "version": "1.0.0-rc.98",
4
+ "version": "1.0.0-rc.99",
5
5
  "description": "The Plugin for VuePress 2 - markdown power",
6
6
  "author": "pengzhanbo <volodymyr@foxmail.com>",
7
7
  "license": "MIT",
@@ -35,14 +35,14 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@vuepress/helper": "2.0.0-rc.42",
38
- "@vueuse/core": "^11.0.3",
38
+ "@vueuse/core": "^11.1.0",
39
39
  "image-size": "^1.1.1",
40
40
  "markdown-it-container": "^4.0.0",
41
41
  "nanoid": "^5.0.7",
42
- "shiki": "^1.17.0",
43
- "tm-grammars": "^1.17.18",
44
- "tm-themes": "^1.8.1",
45
- "vue": "^3.5.4"
42
+ "shiki": "^1.17.7",
43
+ "tm-grammars": "^1.17.22",
44
+ "tm-themes": "^1.8.2",
45
+ "vue": "^3.5.6"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/markdown-it": "^14.1.2"