all repos — grayfriday @ 8ca36f24b78b58fd3e812987cfd45975fd9ed1af

blackfriday fork with a few changes

Support passing either width or height
Anirudh Oppiliappan x@icyphox.sh
Tue, 21 Jun 2022 21:59:04 +0530
commit

8ca36f24b78b58fd3e812987cfd45975fd9ed1af

parent

a110088781ed1fabba4a59d6355a9058dc4fdf6a

1 files changed, 6 insertions(+), 1 deletions(-)

jump to
M html.gohtml.go

@@ -614,9 +614,14 @@ if node.LinkData.Title != nil {

r.out(w, []byte(`" title="`)) escapeHTML(w, node.LinkData.Title) } - if node.LinkData.Width != 0 { + switch { + case node.LinkData.Width != 0 && node.LinkData.Height != 0: r.out(w, []byte(fmt.Sprintf(`" width="%d" height="%d`, node.LinkData.Width, node.LinkData.Height))) + case node.LinkData.Width != 0: + r.out(w, []byte(fmt.Sprintf(`" width="%d`, node.LinkData.Width))) + case node.LinkData.Height != 0: + r.out(w, []byte(fmt.Sprintf(`" height="%d`, node.LinkData.Height))) } r.out(w, []byte(`" />`)) }