diff options
author | bptato <nincsnevem662@gmail.com> | 2022-07-29 18:35:09 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2022-07-29 18:35:09 +0200 |
commit | 70c54e2a05426b2ba9d155440fa06c19fabd4c52 (patch) | |
tree | 2178b2ca4ae30950bcd272d245cb4fdfb77df0b1 /src/html | |
parent | 6a5b629b4ed2203c62ca1e7d2b060b8cb28b7125 (diff) | |
download | chawan-70c54e2a05426b2ba9d155440fa06c19fabd4c52.tar.gz |
Fix incorrect use of del()
Diffstat (limited to 'src/html')
-rw-r--r-- | src/html/dom.nim | 2 | ||||
-rw-r--r-- | src/html/htmlparser.nim | 22 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/html/dom.nim b/src/html/dom.nim index 2c6b9134..109e5dc9 100644 --- a/src/html/dom.nim +++ b/src/html/dom.nim @@ -736,7 +736,7 @@ proc remove*(node: Node) = #TODO NodeIterator let oldPreviousSibling = node.previousSibling let oldNextSibling = node.nextSibling - parent.childNodes.del(index) + parent.childNodes.delete(index) if oldPreviousSibling != nil: oldPreviousSibling.nextSibling = oldNextSibling if oldNextSibling != nil: diff --git a/src/html/htmlparser.nim b/src/html/htmlparser.nim index 3911578b..e3c66f79 100644 --- a/src/html/htmlparser.nim +++ b/src/html/htmlparser.nim @@ -495,7 +495,7 @@ proc pushOntoActiveFormatting(parser: var HTML5Parser, element: Element, token: if fail: continue inc count if count == 3: - parser.activeFormatting.del(i) + parser.activeFormatting.delete(i) break parser.activeFormatting.add((element, token)) @@ -901,7 +901,7 @@ proc processInHTMLContent(parser: var HTML5Parser, token: Token, insertionMode = parser.processInHTMLContent(token, IN_HEAD) for i in countdown(parser.openElements.high, 0): if parser.openElements[i] == parser.head: - parser.openElements.del(i) + parser.openElements.delete(i) ) "</template>" => (block: parser.processInHTMLContent(token, IN_HEAD)) ("</body>", "</html>", "</br>") => (block: anything_else) @@ -947,7 +947,7 @@ proc processInHTMLContent(parser: var HTML5Parser, token: Token, insertionMode = let stackIndex = parser.openElements.find(formatting) if stackIndex < 0: parse_error - parser.activeFormatting.del(formattingIndex) + parser.activeFormatting.delete(formattingIndex) return false if not parser.openElements.hasElementInScope(formatting): parse_error @@ -964,7 +964,7 @@ proc processInHTMLContent(parser: var HTML5Parser, token: Token, insertionMode = break if furthestBlock == nil: while parser.openElements.pop() != formatting: discard - parser.activeFormatting.del(formattingIndex) + parser.activeFormatting.delete(formattingIndex) return false let commonAncestor = parser.openElements[stackIndex - 1] var bookmark = formattingIndex @@ -982,12 +982,12 @@ proc processInHTMLContent(parser: var HTML5Parser, token: Token, insertionMode = nodeFormattingIndex = i break if j > 3 and nodeFormattingIndex >= 0: - parser.activeFormatting.del(nodeFormattingIndex) + parser.activeFormatting.delete(nodeFormattingIndex) if nodeFormattingIndex < bookmark: dec bookmark # a previous node got deleted, so decrease bookmark by one let nodeStackIndex = parser.openElements.find(node) if nodeFormattingIndex < 0: - parser.openElements.del(nodeStackIndex) + parser.openElements.delete(nodeStackIndex) if nodeStackIndex < furthestBlockIndex: dec furthestBlockIndex continue @@ -1009,9 +1009,9 @@ proc processInHTMLContent(parser: var HTML5Parser, token: Token, insertionMode = element.append(child) furthestBlock.append(element) parser.activeFormatting.insert((element, token), bookmark) - parser.activeFormatting.del(formattingIndex) + parser.activeFormatting.delete(formattingIndex) parser.openElements.insert(element, furthestBlockIndex) - parser.openElements.del(stackIndex) + parser.openElements.delete(stackIndex) template any_other_start_tag() = parser.reconstructActiveFormatting() @@ -1208,7 +1208,7 @@ proc processInHTMLContent(parser: var HTML5Parser, token: Token, insertionMode = return parser.generateImpliedEndTags() if parser.currentNode != node: parse_error - parser.openElements.del(parser.openElements.find(node)) + parser.openElements.delete(parser.openElements.find(node)) else: if not parser.openElements.hasElementInScope(TAG_FORM): parse_error @@ -1267,11 +1267,11 @@ proc processInHTMLContent(parser: var HTML5Parser, token: Token, insertionMode = return for i in 0..parser.activeFormatting.high: if parser.activeFormatting[i][0] == anchor: - parser.activeFormatting.del(i) + parser.activeFormatting.delete(i) break for i in 0..parser.openElements.high: if parser.openElements[i] == anchor: - parser.openElements.del(i) + parser.openElements.delete(i) break parser.reconstructActiveFormatting() let element = parser.insertHTMLElement(token) |