diff options
author | bptato <nincsnevem662@gmail.com> | 2023-06-25 14:07:31 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-06-25 14:07:31 +0200 |
commit | bd0d0f9185fabf887202a39f9dd823c6c511f839 (patch) | |
tree | 382d8fd9cf730863e97ce883d535f69a2a488f88 /src/buffer/buffer.nim | |
parent | 1d517e0edfd8eef62e9c0dfb7fa6f70c25a92ed8 (diff) | |
download | chawan-bd0d0f9185fabf887202a39f9dd823c6c511f839.tar.gz |
buffer: only load images if config allows it
Diffstat (limited to 'src/buffer/buffer.nim')
-rw-r--r-- | src/buffer/buffer.nim | 5 |
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: |