Show HTML on website
This commit is contained in:
parent
ad9bfb2439
commit
aa034701df
@ -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)
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,10 @@
|
||||
{{define "page-content"}}
|
||||
<form>
|
||||
<textarea name="editor-textarea"></textarea>
|
||||
<input type="submit" value="Senden" hx-post="/finished-edit/">
|
||||
<input type="submit" value="Senden" hx-post="/finished-edit/" hx-target="#page-content">
|
||||
</form>
|
||||
{{end}}
|
||||
|
||||
{{define "html-result"}}
|
||||
{{.}}
|
||||
{{end}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user