Skip to content

Commit

Permalink
fix checker
Browse files Browse the repository at this point in the history
  • Loading branch information
dzencot committed Jul 3, 2024
1 parent 14f0ec1 commit f10a9ba
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 20 deletions.
15 changes: 1 addition & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"glob": "^10.4.2",
"lodash": "^4.17.21",
"mdast-util-from-markdown": "^2.0.0",
"mdast-util-to-markdown": "^2.1.0",
"uuid": "^9.0.1"
"mdast-util-to-markdown": "^2.1.0"
}
}
7 changes: 3 additions & 4 deletions src/markdownParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,11 @@ class Parser {
const iter = (tree) => {
if (this.filterBlocks.includes(tree.type)) {
const currentNode = _.cloneDeep(tree);
currentNode.id = uuidv4();
this.filteredData.push(currentNode);
if (tree.children) {
tree.children = [];
}
tree.value = currentNode.id;
tree.value = '';
return;
}
if (tree.children) {
Expand All @@ -61,11 +60,11 @@ class Parser {
const mkTree = fromMarkdown(content);
const iter = (tree) => {
if (this.filterBlocks.includes(tree.type)) {
const currentNode = this.filteredData.find((node) => node.id === tree.value);
const currentNode = this.filteredData.shift();
if (currentNode.children) {
tree.children = currentNode.children;
}
tree.value = currentNode.id;
tree.value = currentNode.value;
return;
}
if (tree.children) {
Expand Down

0 comments on commit f10a9ba

Please sign in to comment.