Skip to content

Commit 5858b00

Browse files
committed
serve html directly, no parsing
1 parent 9ecaea5 commit 5858b00

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

desk/app/scratch/view.hoon

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,13 @@
2525
=/ =file (~(got by pile) key)
2626
=/ norm=tape (scan (trip text.file) (star ;~(pose (cold '\\`' (just '`')) next)))
2727
^- reply:rudder
28+
?: =(%html view.file)
29+
=/ hdr=response-header:http [200 ~[['content-type' 'text/html']]]
30+
=/ =octs (as-octs:mimes:html text.file)
31+
[%full [hdr `octs] &]
2832
|^ [%page page &]
2933
++ page
3034
:: compile
31-
?: =(%html view.file)
32-
?~ content=(de-xml:html text.file)
33-
;html
34-
;body
35-
;div: Unable to parse HTML
36-
==
37-
==
38-
u.content
3935
?< ?=(%html view.file)
4036
%^ template q.byk.bowl "{(trip key)} | scratch"
4137
:~ ;script: {data}

0 commit comments

Comments
 (0)