forked from lug/matterbridge
Update dependencies and build to go1.22 (#2113)
* Update dependencies and build to go1.22 * Fix api changes wrt to dependencies * Update golangci config
This commit is contained in:
12
vendor/github.com/gomarkdown/markdown/README.md
generated
vendored
12
vendor/github.com/gomarkdown/markdown/README.md
generated
vendored
@@ -9,11 +9,11 @@ It's very fast and supports common extensions.
|
||||
Tutorial: https://blog.kowalczyk.info/article/cxn3/advanced-markdown-processing-in-go.html
|
||||
|
||||
Code examples:
|
||||
* https://onlinetool.io/goplayground/#txO7hJ-ibeU : basic markdown => HTML
|
||||
* https://onlinetool.io/goplayground/#yFRIWRiu-KL : customize HTML renderer
|
||||
* https://onlinetool.io/goplayground/#2yV5-HDKBUV : modify AST
|
||||
* https://onlinetool.io/goplayground/#9fqKwRbuJ04 : customize parser
|
||||
* https://onlinetool.io/goplayground/#Bk0zTvrzUDR : syntax highlight
|
||||
* https://tools.arslexis.io/goplayground/#txO7hJ-ibeU : basic markdown => HTML
|
||||
* https://tools.arslexis.io/goplayground/#yFRIWRiu-KL : customize HTML renderer
|
||||
* https://tools.arslexis.io/goplayground/#2yV5-HDKBUV : modify AST
|
||||
* https://tools.arslexis.io/goplayground/#9fqKwRbuJ04 : customize parser
|
||||
* https://tools.arslexis.io/goplayground/#Bk0zTvrzUDR : syntax highlight
|
||||
|
||||
Those examples are also in [examples](./examples) directory.
|
||||
|
||||
@@ -226,7 +226,7 @@ implements the following extensions:
|
||||
- **Hard line breaks**. With this extension enabled newlines in the input
|
||||
translates into line breaks in the output. This extension is off by default.
|
||||
|
||||
- **Non blocking space**. With this extension enabled spaces preceeded by a backslash
|
||||
- **Non blocking space**. With this extension enabled spaces preceded by a backslash
|
||||
in the input translates non-blocking spaces in the output. This extension is off by default.
|
||||
|
||||
- **Smart quotes**. Smartypants-style punctuation substitution is
|
||||
|
||||
7
vendor/github.com/gomarkdown/markdown/parser/block.go
generated
vendored
7
vendor/github.com/gomarkdown/markdown/parser/block.go
generated
vendored
@@ -191,6 +191,11 @@ func (p *Parser) Block(data []byte) {
|
||||
// <div>
|
||||
// ...
|
||||
// </div>
|
||||
|
||||
if len(data) == 0 {
|
||||
continue
|
||||
}
|
||||
|
||||
if data[0] == '<' {
|
||||
if i := p.html(data, true); i > 0 {
|
||||
data = data[i:]
|
||||
@@ -393,7 +398,7 @@ func (p *Parser) AddBlock(n ast.Node) ast.Node {
|
||||
}
|
||||
|
||||
func (p *Parser) isPrefixHeading(data []byte) bool {
|
||||
if data[0] != '#' {
|
||||
if len(data) > 0 && data[0] != '#' {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
5
vendor/github.com/gomarkdown/markdown/parser/citation.go
generated
vendored
5
vendor/github.com/gomarkdown/markdown/parser/citation.go
generated
vendored
@@ -65,6 +65,11 @@ func citation(p *Parser, data []byte, offset int) (int, ast.Node) {
|
||||
}
|
||||
|
||||
citeType := ast.CitationTypeInformative
|
||||
|
||||
if len(citation) < 2 {
|
||||
continue
|
||||
}
|
||||
|
||||
j = 1
|
||||
switch citation[j] {
|
||||
case '!':
|
||||
|
||||
2
vendor/github.com/gomarkdown/markdown/parser/inline.go
generated
vendored
2
vendor/github.com/gomarkdown/markdown/parser/inline.go
generated
vendored
@@ -736,7 +736,7 @@ func leftAngle(p *Parser, data []byte, offset int) (int, ast.Node) {
|
||||
}
|
||||
|
||||
// '\\' backslash escape
|
||||
var escapeChars = []byte("\\`*_{}[]()#+-.!:|&<>~^")
|
||||
var escapeChars = []byte("\\`*_{}[]()#+-.!:|&<>~^$")
|
||||
|
||||
func escape(p *Parser, data []byte, offset int) (int, ast.Node) {
|
||||
data = data[offset:]
|
||||
|
||||
13
vendor/github.com/gomarkdown/markdown/parser/parser.go
generated
vendored
13
vendor/github.com/gomarkdown/markdown/parser/parser.go
generated
vendored
@@ -56,7 +56,7 @@ const (
|
||||
)
|
||||
|
||||
// for each character that triggers a response when parsing inline data.
|
||||
type inlineParser func(p *Parser, data []byte, offset int) (int, ast.Node)
|
||||
type InlineParser func(p *Parser, data []byte, offset int) (int, ast.Node)
|
||||
|
||||
// ReferenceOverrideFunc is expected to be called with a reference string and
|
||||
// return either a valid Reference type that the reference string maps to or
|
||||
@@ -98,7 +98,7 @@ type Parser struct {
|
||||
|
||||
refs map[string]*reference
|
||||
refsRecord map[string]struct{}
|
||||
inlineCallback [256]inlineParser
|
||||
inlineCallback [256]InlineParser
|
||||
nesting int
|
||||
maxNesting int
|
||||
insideLink bool
|
||||
@@ -181,6 +181,12 @@ func NewWithExtensions(extension Extensions) *Parser {
|
||||
return &p
|
||||
}
|
||||
|
||||
func (p *Parser) RegisterInline(n byte, fn InlineParser) InlineParser {
|
||||
prev := p.inlineCallback[n]
|
||||
p.inlineCallback[n] = fn
|
||||
return prev
|
||||
}
|
||||
|
||||
func (p *Parser) getRef(refid string) (ref *reference, found bool) {
|
||||
if p.ReferenceOverride != nil {
|
||||
r, overridden := p.ReferenceOverride(refid)
|
||||
@@ -901,6 +907,9 @@ func isListItem(d ast.Node) bool {
|
||||
}
|
||||
|
||||
func NormalizeNewlines(d []byte) []byte {
|
||||
res := make([]byte, len(d))
|
||||
copy(res, d)
|
||||
d = res
|
||||
wi := 0
|
||||
n := len(d)
|
||||
for i := 0; i < n; i++ {
|
||||
|
||||
Reference in New Issue
Block a user