mirror of
https://github.com/russross/blackfriday.git
synced 2024-03-22 13:40:34 +08:00
Merge pull request #296 from Ambrevar/v2icon
v2: Add Icon parameter to the HTML renderer
This commit is contained in:
commit
37141d5b5a
8
html.go
8
html.go
|
@ -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")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user