Insert content into editor
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
5116d35c06
commit
35849b8a33
7
main.go
7
main.go
|
@ -4,6 +4,7 @@ import (
|
|||
"encoding/json"
|
||||
"flag"
|
||||
"fmt"
|
||||
"html"
|
||||
"html/template"
|
||||
"log"
|
||||
"net/http"
|
||||
|
@ -341,8 +342,8 @@ func (h *editHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
} else {
|
||||
editor = `
|
||||
<textarea name="content" rows="24" style="width:100%">{{ .Content }}</textarea>
|
||||
editor = template.HTML(fmt.Sprintf(`
|
||||
<textarea name="content" rows="24" style="width:100%%">%s</textarea>
|
||||
<br>
|
||||
|
||||
<div class="field">
|
||||
|
@ -352,7 +353,7 @@ func (h *editHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
</div>
|
||||
</div>
|
||||
<button class="button is-primary" type="submit">Save</button>
|
||||
`
|
||||
`, html.EscapeString(pageText)))
|
||||
}
|
||||
|
||||
data := editPage{
|
||||
|
|
Loading…
Reference in New Issue
Block a user