1
0
forked from lug/matterbridge

Update Blackfriday dependency (closes #522) (#532)

- Fixup Telegram bridge implementation to support updated dependency.
This commit is contained in:
Duco van Amstel
2018-10-22 10:48:29 -07:00
committed by Wim
parent 6911458d15
commit f2cdda7278
19 changed files with 2542 additions and 2297 deletions

34
vendor/github.com/russross/blackfriday/esc.go generated vendored Normal file
View File

@@ -0,0 +1,34 @@
package blackfriday
import (
"html"
"io"
)
var htmlEscaper = [256][]byte{
'&': []byte("&"),
'<': []byte("&lt;"),
'>': []byte("&gt;"),
'"': []byte("&quot;"),
}
func escapeHTML(w io.Writer, s []byte) {
var start, end int
for end < len(s) {
escSeq := htmlEscaper[s[end]]
if escSeq != nil {
w.Write(s[start:end])
w.Write(escSeq)
start = end + 1
}
end++
}
if start < len(s) && end <= len(s) {
w.Write(s[start:end])
}
}
func escLink(w io.Writer, text []byte) {
unesc := html.UnescapeString(string(text))
escapeHTML(w, []byte(unesc))
}