Skip to content

Web Preview Got Exceptions for HTML Syntax #25

@AnqianW

Description

@AnqianW

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions