github_flavored_markdown
github_flavored_markdown copied to clipboard
Web Preview Got Exceptions for HTML Syntax
For https://pkg.go.dev/github.com/shurcooL/github_flavored_markdown#example-Markdown-CompleteHTMLPage
I tried with http handler:
http.Handle("/assets/", http.StripPrefix("/assets", http.FileServer(gfmstyle.Assets)))
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
io.WriteString(w, `<html><head><meta charset="utf-8"><link href="/assets/gfm.css" media="all" rel="stylesheet" type="text/css" /><link href="//cdnjs.cloudflare.com/ajax/libs/octicons/2.1.2/octicons.css" media="all" rel="stylesheet" type="text/css" /></head><body><article class="markdown-body entry-content" style="padding: 30px;">`)
markdown := []byte("# GitHub Flavored Markdown\n\nHello.")
w.Write(github_flavored_markdown.Markdown(markdown))
io.WriteString(w, `</article></body></html>`)
})
http.ListenAndServe(":8000", nil)
But I only got blank page on Chrome with the following syntax errors in console:
