diff --git a/plugins/plugin-md-power/__test__/__snapshots__/fileTreePlugin.spec.ts.snap b/plugins/plugin-md-power/__test__/__snapshots__/fileTreePlugin.spec.ts.snap index 42d0caaf..b76ed869 100644 --- a/plugins/plugin-md-power/__test__/__snapshots__/fileTreePlugin.spec.ts.snap +++ b/plugins/plugin-md-power/__test__/__snapshots__/fileTreePlugin.spec.ts.snap @@ -6,17 +6,32 @@ exports[`fileTree > parseFileTreeRawContent > should work 1`] = ` "children": [ { "children": [], - "info": "README.md", + "comment": "", + "diff": undefined, + "expanded": true, + "filename": "README.md", + "focus": false, "level": 1, + "type": "file", }, { "children": [], - "info": "foo.md", + "comment": "", + "diff": undefined, + "expanded": true, + "filename": "foo.md", + "focus": false, "level": 1, + "type": "file", }, ], - "info": "docs", + "comment": "", + "diff": undefined, + "expanded": true, + "filename": "docs", + "focus": false, "level": 0, + "type": "file", }, { "children": [ @@ -26,52 +41,97 @@ exports[`fileTree > parseFileTreeRawContent > should work 1`] = ` "children": [ { "children": [], - "info": "**Navbar.vue**", + "comment": "", + "diff": undefined, + "expanded": true, + "filename": "Navbar.vue", + "focus": true, "level": 3, + "type": "file", }, ], - "info": "components", + "comment": "", + "diff": undefined, + "expanded": true, + "filename": "components", + "focus": false, "level": 2, + "type": "file", }, { "children": [], - "info": "index.ts # comment", + "comment": "# comment", + "diff": undefined, + "expanded": true, + "filename": "index.ts", + "focus": false, "level": 2, + "type": "file", }, ], - "info": "client", + "comment": "", + "diff": undefined, + "expanded": true, + "filename": "client", + "focus": false, "level": 1, + "type": "file", }, { "children": [ { "children": [], - "info": "index.ts", + "comment": "", + "diff": undefined, + "expanded": true, + "filename": "index.ts", + "focus": false, "level": 2, + "type": "file", }, ], - "info": "node", + "comment": "", + "diff": undefined, + "expanded": true, + "filename": "node", + "focus": false, "level": 1, + "type": "file", }, ], - "info": "src", + "comment": "", + "diff": undefined, + "expanded": true, + "filename": "src", + "focus": false, "level": 0, + "type": "file", }, { "children": [], - "info": ".gitignore", + "comment": "", + "diff": undefined, + "expanded": true, + "filename": ".gitignore", + "focus": false, "level": 0, + "type": "file", }, { "children": [], - "info": "package.json", + "comment": "", + "diff": undefined, + "expanded": true, + "filename": "package.json", + "focus": false, "level": 0, + "type": "file", }, ] `; exports[`fileTreePlugin > should work with default options 1`] = ` -"
+"
@@ -102,7 +162,7 @@ exports[`fileTreePlugin > should work with default options 1`] = `
-

files

+

files

@@ -122,7 +182,7 @@ exports[`fileTreePlugin > should work with default options 1`] = `
-
+
@@ -136,7 +196,7 @@ exports[`fileTreePlugin > should work with default options 1`] = `
-
+
@@ -144,7 +204,7 @@ exports[`fileTreePlugin > should work with default options 1`] = `
-
+
@@ -158,7 +218,7 @@ exports[`fileTreePlugin > should work with default options 1`] = `
-
+
" `; @@ -166,7 +226,7 @@ exports[`fileTreePlugin > should work with nesting content 1`] = ` "
  • item1

    -
    +
    diff --git a/plugins/plugin-md-power/__test__/fileTreePlugin.spec.ts b/plugins/plugin-md-power/__test__/fileTreePlugin.spec.ts index 74b6701a..54325d46 100644 --- a/plugins/plugin-md-power/__test__/fileTreePlugin.spec.ts +++ b/plugins/plugin-md-power/__test__/fileTreePlugin.spec.ts @@ -56,7 +56,9 @@ describe('fileTree > parseFileTreeNodeInfo', () => { }) function createMarkdown(options?: FileTreeOptions) { - return new MarkdownIt().use(fileTreePlugin, options) + const md = new MarkdownIt() + fileTreePlugin(md, options, {}) + return md } describe('fileTreePlugin', () => { diff --git a/plugins/plugin-md-power/src/client/components/FileTreeNode.vue b/plugins/plugin-md-power/src/client/components/FileTreeNode.vue index 60b3c5e3..5c8a8edd 100644 --- a/plugins/plugin-md-power/src/client/components/FileTreeNode.vue +++ b/plugins/plugin-md-power/src/client/components/FileTreeNode.vue @@ -68,6 +68,7 @@ function toggle(ev: MouseEvent) {