Skip to content

Commit 450b73d

Browse files
committed
0.0.5 - even better error handling
1 parent 126a473 commit 450b73d

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@ create_dom_diff = async (html) => {
1111
let parser = await create_dom_diff.parser_p
1212
let tree = parser.parse(html)
1313

14+
if (hasErrorNode(tree.rootNode)) {
15+
html = ''
16+
tree = parser.parse(html)
17+
}
18+
1419
return {
20+
get: () => html,
1521
patch: (...args) => {
1622
let [start, end, content, start_row_col, end_row_col, end2_row_col] = args
1723

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@braidjs/dom-diff",
3-
"version": "0.0.4",
3+
"version": "0.0.5",
44
"description": "utilities for diffing html doms",
55
"author": "Braid Working Group",
66
"repository": "braid-org/dom-diff",

0 commit comments

Comments
 (0)