Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Web Preview Got Exceptions for HTML Syntax #25

Open
AnqianW opened this issue Oct 2, 2021 · 0 comments
Open

Web Preview Got Exceptions for HTML Syntax #25

AnqianW opened this issue Oct 2, 2021 · 0 comments

Comments

@AnqianW
Copy link

AnqianW commented Oct 2, 2021

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:
截屏2021-10-01 14 41 44
截屏2021-10-01 14 41 59

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant