aboutsummaryrefslogtreecommitdiffstats
path: root/src/html
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-03-19 16:37:50 +0100
committerbptato <nincsnevem662@gmail.com>2024-03-19 16:52:31 +0100
commit572aa39ffa06042a3c0ff5c5607a44cf0d30d9f2 (patch)
treee5b0d259db69f3e89b74aa60d7eac6784d3f14ec /src/html
parent75a56860eeddab2776b0e9c04861787694ef298c (diff)
downloadchawan-572aa39ffa06042a3c0ff5c5607a44cf0d30d9f2.tar.gz
buffer: add markURL
Useful when browsing plaintext files; w3m has it too.
Diffstat (limited to 'src/html')
-rw-r--r--src/html/dom.nim8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/html/dom.nim b/src/html/dom.nim
index 163e4a66..39083db2 100644
--- a/src/html/dom.nim
+++ b/src/html/dom.nim
@@ -3334,8 +3334,8 @@ proc insertNode(parent, node, before: Node) =
insertionSteps(node)
# WARNING ditto
-proc insert*(parent, node, before: Node, suppressObservers = false) =
- let nodes = if node of DocumentFragment:
+proc insert*(parent, node, before: Node; suppressObservers = false) =
+ var nodes = if node of DocumentFragment:
node.childList
else:
@[node]
@@ -3381,7 +3381,7 @@ proc removeChild(parent, node: Node): DOMResult[Node] {.jsfunc.} =
# doesn't match that
# Note: the standard returns child if not err. We don't, it's just a
# pointless copy.
-proc replace(parent, child, node: Node): Err[DOMException] =
+proc replace*(parent, child, node: Node): Err[DOMException] =
?checkParentValidity(parent)
if node.isHostIncludingInclusiveAncestor(parent):
return errDOMException("Parent must be an ancestor",
@@ -4036,7 +4036,7 @@ proc toBlob(ctx: JSContext, this: HTMLCanvasElement, callback: JSValue,
import html/chadombuilder
# https://w3c.github.io/DOM-Parsing/#dfn-fragment-parsing-algorithm
-proc fragmentParsingAlgorithm(element: Element, s: string): DocumentFragment =
+proc fragmentParsingAlgorithm*(element: Element; s: string): DocumentFragment =
#TODO xml
let newChildren = parseHTMLFragment(element, s)
let fragment = element.document.newDocumentFragment()