about summary refs log tree commit diff stats
path: root/src/buffer/buffer.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-06-25 14:07:31 +0200
committerbptato <nincsnevem662@gmail.com>2023-06-25 14:07:31 +0200
commitbd0d0f9185fabf887202a39f9dd823c6c511f839 (patch)
tree382d8fd9cf730863e97ce883d535f69a2a488f88 /src/buffer/buffer.nim
parent1d517e0edfd8eef62e9c0dfb7fa6f70c25a92ed8 (diff)
downloadchawan-bd0d0f9185fabf887202a39f9dd823c6c511f839.tar.gz
buffer: only load images if config allows it
Diffstat (limited to 'src/buffer/buffer.nim')
-rw-r--r--src/buffer/buffer.nim5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/buffer/buffer.nim b/src/buffer/buffer.nim
index ae187824..c637405c 100644
--- a/src/buffer/buffer.nim
+++ b/src/buffer/buffer.nim
@@ -604,7 +604,10 @@ proc loadResources(buffer: Buffer): EmptyPromise =
   let document = buffer.document
   var promises: seq[EmptyPromise]
   if document.html != nil:
-    for elem in document.html.elements({TAG_LINK, TAG_IMG}):
+    var searchElems = {TAG_LINK}
+    if buffer.config.images:
+      searchElems.incl(TAG_IMG)
+    for elem in document.html.elements(searchElems):
       var p: EmptyPromise = nil
       case elem.tagType
       of TAG_LINK: