Merge pull request #296 from Ambrevar/v2icon

v2: Add Icon parameter to the HTML renderer
This commit is contained in:
Vytautas Šaltenis 2016-08-09 22:22:31 +03:00 committed by GitHub
commit 37141d5b5a

View File

@ -83,6 +83,7 @@ type HTMLRendererParameters struct {
Title string // Document title (used if CompletePage is set)
CSS string // Optional CSS file URL (used if CompletePage is set)
Icon string // Optional icon file URL (used if CompletePage is set)
Flags HTMLFlags // Flags allow customizing this renderer's behavior
Extensions Extensions // Extensions give Smartypants and HTML renderer access to Blackfriday's global extensions
@ -741,6 +742,13 @@ func (r *HTMLRenderer) writeDocumentHeader(w *bytes.Buffer, sr *SPRenderer) {
w.WriteString(ending)
w.WriteString(">\n")
}
if r.Icon != "" {
w.WriteString(" <link rel=\"icon\" type=\"image/x-icon\" href=\"")
w.Write(esc([]byte(r.Icon)))
w.WriteString("\"")
w.WriteString(ending)
w.WriteString(">\n")
}
w.WriteString("</head>\n")
w.WriteString("<body>\n\n")
}