summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/gomarkdown/markdown/html/callouts.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2020-11-22 15:55:57 +0100
committerGitHub <noreply@github.com>2020-11-22 15:55:57 +0100
commit4cc2c914e634eb8c79eb61aa1bc29faf6021ffcf (patch)
tree92d3b8d27cd35455eae7423e4d47aad67cc6a43b /vendor/github.com/gomarkdown/markdown/html/callouts.go
parentcbb46293ab670c1989bfcd9aae5d853223074038 (diff)
downloadmatterbridge-msglm-4cc2c914e634eb8c79eb61aa1bc29faf6021ffcf.tar.gz
matterbridge-msglm-4cc2c914e634eb8c79eb61aa1bc29faf6021ffcf.tar.bz2
matterbridge-msglm-4cc2c914e634eb8c79eb61aa1bc29faf6021ffcf.zip
Update vendor (#1297)
Diffstat (limited to 'vendor/github.com/gomarkdown/markdown/html/callouts.go')
-rw-r--r--vendor/github.com/gomarkdown/markdown/html/callouts.go42
1 files changed, 0 insertions, 42 deletions
diff --git a/vendor/github.com/gomarkdown/markdown/html/callouts.go b/vendor/github.com/gomarkdown/markdown/html/callouts.go
deleted file mode 100644
index e377af22..00000000
--- a/vendor/github.com/gomarkdown/markdown/html/callouts.go
+++ /dev/null
@@ -1,42 +0,0 @@
-package html
-
-import (
- "bytes"
- "io"
-
- "github.com/gomarkdown/markdown/ast"
- "github.com/gomarkdown/markdown/parser"
-)
-
-// EscapeHTMLCallouts writes html-escaped d to w. It escapes &, <, > and " characters, *but*
-// expands callouts <<N>> with the callout HTML, i.e. by calling r.callout() with a newly created
-// ast.Callout node.
-func (r *Renderer) EscapeHTMLCallouts(w io.Writer, d []byte) {
- ld := len(d)
-Parse:
- for i := 0; i < ld; i++ {
- for _, comment := range r.opts.Comments {
- if !bytes.HasPrefix(d[i:], comment) {
- break
- }
-
- lc := len(comment)
- if i+lc < ld {
- if id, consumed := parser.IsCallout(d[i+lc:]); consumed > 0 {
- // We have seen a callout
- callout := &ast.Callout{ID: id}
- r.callout(w, callout)
- i += consumed + lc - 1
- continue Parse
- }
- }
- }
-
- escSeq := Escaper[d[i]]
- if escSeq != nil {
- w.Write(escSeq)
- } else {
- w.Write([]byte{d[i]})
- }
- }
-}