diff options
author | bptato <nincsnevem662@gmail.com> | 2024-03-21 16:17:52 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-03-21 16:17:52 +0100 |
commit | e4463ecb7c435894c5a67a3377823ab0f991a191 (patch) | |
tree | b478d4723a55eef2ade9318a31820fb37db57e0c /src/html | |
parent | 1d660ce00967c2a457158eae85dd82247c2ae396 (diff) | |
download | chawan-e4463ecb7c435894c5a67a3377823ab0f991a191.tar.gz |
buffer: send title during load + other title stuff
* send title to pager as soon as it's available * expose `title' to DOM * rename undocumented `getTitle' js function to `title' getter in Container
Diffstat (limited to 'src/html')
-rw-r--r-- | src/html/dom.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/html/dom.nim b/src/html/dom.nim index 39083db2..a452442a 100644 --- a/src/html/dom.nim +++ b/src/html/dom.nim @@ -2653,8 +2653,8 @@ func parseURL*(document: Document, s: string): Option[URL] = func media*[T: HTMLLinkElement|HTMLStyleElement](element: T): string = return element.attr(atMedia) -func title*(document: Document): string = - for title in document.elements(TAG_TITLE): +func title*(document: Document): string {.jsfget.} = + if (let title = document.findFirst(TAG_TITLE); title != nil): return title.childTextContent.stripAndCollapse() return "" |