summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/gomarkdown/markdown/html/renderer.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2021-05-05 22:03:28 +0200
committerGitHub <noreply@github.com>2021-05-05 22:03:28 +0200
commita0bca42a7ad98a37f4bdc4d7adc419471163edfb (patch)
tree3e87fdb61128039b016adb4e586636484c63ed52 /vendor/github.com/gomarkdown/markdown/html/renderer.go
parentaf543dcd05cfb5341311e2e214727e26411d2f92 (diff)
downloadmatterbridge-msglm-a0bca42a7ad98a37f4bdc4d7adc419471163edfb.tar.gz
matterbridge-msglm-a0bca42a7ad98a37f4bdc4d7adc419471163edfb.tar.bz2
matterbridge-msglm-a0bca42a7ad98a37f4bdc4d7adc419471163edfb.zip
Update vendor (#1461)
* Update vendored libs * Fix slack api changes
Diffstat (limited to 'vendor/github.com/gomarkdown/markdown/html/renderer.go')
-rw-r--r--vendor/github.com/gomarkdown/markdown/html/renderer.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/vendor/github.com/gomarkdown/markdown/html/renderer.go b/vendor/github.com/gomarkdown/markdown/html/renderer.go
index c57d7eb6..1b466876 100644
--- a/vendor/github.com/gomarkdown/markdown/html/renderer.go
+++ b/vendor/github.com/gomarkdown/markdown/html/renderer.go
@@ -43,6 +43,7 @@ const (
SmartypantsAngledQuotes // Enable angled double quotes (with Smartypants) for double quotes rendering
SmartypantsQuotesNBSP // Enable « French guillemets » (with Smartypants)
TOC // Generate a table of contents
+ LazyLoadImages // Include loading="lazy" with images
CommonFlags Flags = Smartypants | SmartypantsFractions | SmartypantsDashes | SmartypantsLatexDashes
)
@@ -589,7 +590,11 @@ func (r *Renderer) imageEnter(w io.Writer, image *ast.Image) {
//if options.safe && potentiallyUnsafe(dest) {
//out(w, `<img src="" alt="`)
//} else {
- r.Outs(w, `<img src="`)
+ if r.opts.Flags&LazyLoadImages != 0 {
+ r.Outs(w, `<img loading="lazy" src="`)
+ } else {
+ r.Outs(w, `<img src="`)
+ }
escLink(w, dest)
r.Outs(w, `" alt="`)
//}