diff options
author | bptato <nincsnevem662@gmail.com> | 2023-01-02 21:19:46 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-01-02 21:19:46 +0100 |
commit | 62983cdc609aacc47ade0a8a4a4c6b85dd26199a (patch) | |
tree | ab0518ac0f556a499107887fb524beddb80ba104 /src/buffer | |
parent | f2bf1572456412f109d06c6a49e34cfbe924bbfa (diff) | |
download | chawan-62983cdc609aacc47ade0a8a4a4c6b85dd26199a.tar.gz |
dom: add better attribute reflection
Instead of creating a new function for each attribute, use a single magic function for reflected attributes.
Diffstat (limited to 'src/buffer')
-rw-r--r-- | src/buffer/buffer.nim | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/buffer/buffer.nim b/src/buffer/buffer.nim index f7ad6537..34674062 100644 --- a/src/buffer/buffer.nim +++ b/src/buffer/buffer.nim @@ -512,8 +512,9 @@ proc updateHover*(buffer: Buffer, cursorx, cursory: int): UpdateHoverResult {.pr buffer.prevnode = thisnode proc loadResource(buffer: Buffer, document: Document, elem: HTMLLinkElement) = - if elem.href == "": return - let url = parseURL(elem.href, document.url.some) + let href = elem.attr("href") + if href == "": return + let url = parseURL(href, document.url.some) if url.isSome: let url = url.get if url.scheme == buffer.url.scheme: |