about summary refs log tree commit diff stats
path: root/src/main.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2021-08-06 23:24:40 +0200
committerbptato <nincsnevem662@gmail.com>2021-08-06 23:24:40 +0200
commitab963e4efe0871a6bdedf2f56fcfb9ed15636d12 (patch)
tree78397ac1ca492e4be08af07d02a0d609896e8ecc /src/main.nim
parent559d2ca622e15c5781303940bc0c87e9aed1e5d1 (diff)
downloadchawan-ab963e4efe0871a6bdedf2f56fcfb9ed15636d12.tar.gz
HTML display with highly broken box model
Diffstat (limited to 'src/main.nim')
-rw-r--r--src/main.nim10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main.nim b/src/main.nim
index eaed73ed..fe7eeb99 100644
--- a/src/main.nim
+++ b/src/main.nim
@@ -6,6 +6,7 @@ import streams
 import utils/eprint
 
 import html/htmlparser
+import html/dom
 
 import io/buffer
 import io/term
@@ -45,10 +46,11 @@ proc main*() =
   let buffer = newBuffer(attrs)
   let uri = parseUri(paramStr(1))
   buffers.add(buffer)
-  #buffer.document = parseHtml(getPageUri(uri))
-  #buffer.setLocation(uri)
-  #buffer.document.applyDefaultStylesheet()
-  buffer.renderPlainText(getPageUri(uri).readAll())
+  buffer.document = parseHtml(getPageUri(uri))
+  buffer.setLocation(uri)
+  buffer.document.applyDefaultStylesheet()
+  #buffer.renderPlainText(getPageUri(uri).readAll())
+  buffer.renderDocument()
   var lastUri = uri
   while displayPage(attrs, buffer):
     buffer.setStatusMessage("Loading...")