diff --git a/cmd/handlers/editor.go b/cmd/handlers/editor.go index 1ff3282..84291a2 100644 --- a/cmd/handlers/editor.go +++ b/cmd/handlers/editor.go @@ -1,7 +1,7 @@ package handlers import ( - "fmt" + "html/template" "log" "net/http" @@ -18,6 +18,6 @@ func HandleFinishedEdit() http.HandlerFunc { log.Panicln(err) } - fmt.Println(html) + template.Must(template.ParseFiles("web/templates/editor.html")).ExecuteTemplate(w, "html-result", html) } } diff --git a/web/templates/editor.html b/web/templates/editor.html index 0a74a5a..010e823 100644 --- a/web/templates/editor.html +++ b/web/templates/editor.html @@ -1,6 +1,10 @@ {{define "page-content"}}
{{end}} + +{{define "html-result"}} +{{.}} +{{end}}