5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-04-20 08:57:30 +00:00
dependabot[bot] 61e00ad587
Bump github.com/russross/blackfriday from 1.6.0 to 2.0.0+incompatible
Bumps [github.com/russross/blackfriday](https://github.com/russross/blackfriday) from 1.6.0 to 2.0.0+incompatible.
- [Release notes](https://github.com/russross/blackfriday/releases)
- [Commits](https://github.com/russross/blackfriday/compare/v1.6.0...v2.0.0)

---
updated-dependencies:
- dependency-name: github.com/russross/blackfriday
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-01 02:17:34 +00:00

35 lines
569 B
Go

package blackfriday
import (
"html"
"io"
)
var htmlEscaper = [256][]byte{
'&': []byte("&amp;"),
'<': []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))
}