Skip to content

Commit

Permalink
Enable XML mode of parsing documents
Browse files Browse the repository at this point in the history
  • Loading branch information
KajP committed Oct 31, 2024
1 parent 8bf8732 commit 28fe96c
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 70 deletions.
121 changes: 53 additions & 68 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
"dependencies": {
"extract-zip": "^1.7.0",
"fs-extra": "^5.0.0",
"htmlparser2": "^7.2.0",
"htmlparser2": "^9.1.0",
"lodash": "^4.17.21",
"md5": "^2.3.0",
"vscode-extension-telemetry-wrapper": "^0.14.0",
Expand Down
3 changes: 2 additions & 1 deletion src/Utils/xml/lexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export function getNodesByTag(text: string, tag: string): Node[] {
// const tokens: number[][] = Lexx(text);
const document: Document = hp.parseDocument(text, {
withEndIndices: true,
withStartIndices: true
withStartIndices: true,
xmlMode: true
});
const ret: Node[] = [];
dfs(document, (node) => isTag(node) && node.tagName === tag, ret);
Expand Down

0 comments on commit 28fe96c

Please sign in to comment.