about summary refs log tree commit diff stats
path: root/src/io/buffer.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-07-14 20:35:16 +0200
committerbptato <nincsnevem662@gmail.com>2022-07-14 20:35:16 +0200
commita9a456e91faa7fe696d3e04eaa177eeb472383e7 (patch)
treef6541a5c3057ba049e8d4db81c915790b0607b5c /src/io/buffer.nim
parent82dd9ac98d40b0416b392b6c82c7fe1acc8fb9de (diff)
downloadchawan-a9a456e91faa7fe696d3e04eaa177eeb472383e7.tar.gz
Fix reloading
Diffstat (limited to 'src/io/buffer.nim')
-rw-r--r--src/io/buffer.nim3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/io/buffer.nim b/src/io/buffer.nim
index 44e5855c..e329b777 100644
--- a/src/io/buffer.nim
+++ b/src/io/buffer.nim
@@ -733,6 +733,9 @@ proc load*(buffer: Buffer) =
   case buffer.contenttype
   of "text/html":
     if not buffer.streamclosed:
+      buffer.source = buffer.istream.readAll()
+      buffer.istream.close()
+      buffer.istream = newStringStream(buffer.source)
       buffer.document = parseHTML5(buffer.istream)
       buffer.streamclosed = true
     else: