Remove prefix matching from claim_comment

Multiple comments are separated by --><!--, so prefix matching isn't required.
pull/7182/head
tbhmens 5 years ago
parent d8c206f58f
commit b91d8f6485
No known key found for this signature in database
GPG Key ID: 89BA86D923F495FD

@ -491,15 +491,8 @@ export function claim_comment(nodes:ChildNodeArray, data) {
nodes, nodes,
(node: ChildNode): node is Comment => node.nodeType === 8, (node: ChildNode): node is Comment => node.nodeType === 8,
(node: Comment) => { (node: Comment) => {
const dataStr = '' + data; node.data = '' + data;
if (node.data.startsWith(dataStr)) { return undefined;
if (node.data.length !== dataStr.length) {
node.data = dataStr;
return comment(node.data.slice(dataStr.length));
}
} else {
node.data = dataStr;
}
}, },
() => comment(data), () => comment(data),
true true

Loading…
Cancel
Save