Show HTML on website
This commit is contained in:
		@@ -1,7 +1,7 @@
 | 
				
			|||||||
package handlers
 | 
					package handlers
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"fmt"
 | 
						"html/template"
 | 
				
			||||||
	"log"
 | 
						"log"
 | 
				
			||||||
	"net/http"
 | 
						"net/http"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -18,6 +18,6 @@ func HandleFinishedEdit() http.HandlerFunc {
 | 
				
			|||||||
			log.Panicln(err)
 | 
								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"}}
 | 
					{{define "page-content"}}
 | 
				
			||||||
<form>
 | 
					<form>
 | 
				
			||||||
    <textarea name="editor-textarea"></textarea>
 | 
					    <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>
 | 
					</form>
 | 
				
			||||||
{{end}}
 | 
					{{end}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					{{define "html-result"}}
 | 
				
			||||||
 | 
					{{.}}
 | 
				
			||||||
 | 
					{{end}}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user