mirror of
https://github.com/kovetskiy/mark.git
synced 2025-01-23 09:13:49 +08:00
Bump goldmark to 1.7.8
This commit is contained in:
parent
82aebec1eb
commit
e7a3877ded
2
go.mod
2
go.mod
@ -12,7 +12,7 @@ require (
|
||||
github.com/reconquest/regexputil-go v0.0.0-20160905154124-38573e70c1f4
|
||||
github.com/stretchr/testify v1.9.0
|
||||
github.com/urfave/cli/v2 v2.27.5
|
||||
github.com/yuin/goldmark v1.7.6
|
||||
github.com/yuin/goldmark v1.7.8
|
||||
golang.org/x/tools v0.26.0
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
)
|
||||
|
4
go.sum
4
go.sum
@ -59,8 +59,8 @@ github.com/urfave/cli/v2 v2.27.5 h1:WoHEJLdsXr6dDWoJgMq/CboDmyY/8HMMH1fTECbih+w=
|
||||
github.com/urfave/cli/v2 v2.27.5/go.mod h1:3Sevf16NykTbInEnD0yKkjDAeZDS0A6bzhBH5hrMvTQ=
|
||||
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4=
|
||||
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM=
|
||||
github.com/yuin/goldmark v1.7.6 h1:cZgJxVh5mL5cu8KOnwxvFJy5TFB0BHUskZZyq7TYbDg=
|
||||
github.com/yuin/goldmark v1.7.6/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E=
|
||||
github.com/yuin/goldmark v1.7.8 h1:iERMLn0/QJeHFhxSt3p6PeN9mGnvIKSpG9YYorDMnic=
|
||||
github.com/yuin/goldmark v1.7.8/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E=
|
||||
github.com/zazab/zhash v0.0.0-20221031090444-2b0d50417446 h1:75pcOSsb40+ub185cJI7g5uykl9Uu76rD5ONzK/4s40=
|
||||
github.com/zazab/zhash v0.0.0-20221031090444-2b0d50417446/go.mod h1:NtepZ8TEXErPsmQDMUoN72f8aIy4+xNinSJ3f1giess=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
|
@ -108,7 +108,7 @@ func ParseBlockQuoteType(node ast.Node, source []byte) BlockQuoteType {
|
||||
if countParagraphs < 2 && entering {
|
||||
if node.Kind() == ast.KindText {
|
||||
n := node.(*ast.Text)
|
||||
t = legacyClassifier.ClassifyingBlockQuote(string(n.Text(source)))
|
||||
t = legacyClassifier.ClassifyingBlockQuote(string(n.Value(source)))
|
||||
// If the node is a text node but classification returned none do not give up!
|
||||
// Find the next two sibling nodes midNode and rightNode,
|
||||
// 1. If both are also a text node
|
||||
@ -124,8 +124,8 @@ func ParseBlockQuoteType(node ast.Node, source []byte) BlockQuoteType {
|
||||
midTextNode := midNode.(*ast.Text)
|
||||
if rightNode != nil && rightNode.Kind() == ast.KindText {
|
||||
rightTextNode := rightNode.(*ast.Text)
|
||||
if string(n.Text(source)) == "[" && string(rightTextNode.Text(source)) == "]" {
|
||||
t = ghAlertsClassifier.ClassifyingBlockQuote(string(midTextNode.Text(source)))
|
||||
if string(n.Value(source)) == "[" && string(rightTextNode.Value(source)) == "]" {
|
||||
t = ghAlertsClassifier.ClassifyingBlockQuote(string(midTextNode.Value(source)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -107,9 +107,9 @@ func nodeToHTMLText(n ast.Node, source []byte) []byte {
|
||||
var buf bytes.Buffer
|
||||
for c := n.FirstChild(); c != nil; c = c.NextSibling() {
|
||||
if s, ok := c.(*ast.String); ok && s.IsCode() {
|
||||
buf.Write(s.Text(source))
|
||||
} else if !c.HasChildren() {
|
||||
buf.Write(util.EscapeHTML(c.Text(source)))
|
||||
buf.Write(s.Value)
|
||||
} else if t, ok := c.(*ast.Text); ok {
|
||||
buf.Write(util.EscapeHTML(t.Value(source)))
|
||||
} else {
|
||||
buf.Write(nodeToHTMLText(c, source))
|
||||
}
|
||||
|
@ -33,7 +33,8 @@ func (r *ConfluenceLinkRenderer) renderLink(writer util.BufWriter, source []byte
|
||||
return ast.WalkStop, err
|
||||
}
|
||||
|
||||
if len(n.Destination) < 4 {
|
||||
if len(string(n.Destination)) < 4 {
|
||||
//nolint:staticcheck
|
||||
_, err := writer.Write(node.Text(source))
|
||||
if err != nil {
|
||||
return ast.WalkStop, err
|
||||
@ -50,6 +51,7 @@ func (r *ConfluenceLinkRenderer) renderLink(writer util.BufWriter, source []byte
|
||||
return ast.WalkStop, err
|
||||
}
|
||||
|
||||
//nolint:staticcheck
|
||||
_, err = writer.Write(node.Text(source))
|
||||
if err != nil {
|
||||
return ast.WalkStop, err
|
||||
|
@ -63,7 +63,7 @@ func (r *ConfluenceTextRenderer) renderText(w util.BufWriter, source []byte, nod
|
||||
if r.EastAsianLineBreaks != html.EastAsianLineBreaksNone && len(value) != 0 {
|
||||
sibling := node.NextSibling()
|
||||
if sibling != nil && sibling.Kind() == ast.KindText {
|
||||
if siblingText := sibling.(*ast.Text).Text(source); len(siblingText) != 0 {
|
||||
if siblingText := sibling.(*ast.Text).Value(source); len(siblingText) != 0 {
|
||||
thisLastRune := util.ToRune(value, len(value)-1)
|
||||
siblingFirstRune, _ := utf8.DecodeRune(siblingText)
|
||||
// Inline the softLineBreak function as it's not public
|
||||
|
Loading…
Reference in New Issue
Block a user