Htmlizer implementation

This commit is contained in:
maddiebaka
2023-08-03 13:42:28 -04:00
parent 9c99732c24
commit 26cbb6d345
4 changed files with 85 additions and 7 deletions

View File

@@ -5,8 +5,8 @@ SERVE_DIR="/Users/madeline/Code/gemini-bridge-rack/gemini"
class SkeksisApp
def call(env)
status = 200
#headers = { "Content-Type" => "text/html" }
headers = {}
headers = { "content-type" => "text/html" }
#headers = {}
body = resolve_path(SERVE_DIR + env['PATH_INFO'])
[status, headers, body]
@@ -18,8 +18,7 @@ class SkeksisApp
elsif File.exist?(path)
file = File.open(path, 'r')
data = file.readlines
Skeksis::Parser.parse(data)
data
[Skeksis.htmlize(data)]
else # path is invalid
return nil
end