diff options
author | 2024-10-21 11:37:00 +0200 | |
---|---|---|
committer | 2024-10-21 11:37:00 +0200 | |
commit | ea1bf5f8a37992aa547573a42332235dc7142399 (patch) | |
tree | 9f89eabc416ec6339f02d4092182e055a8227f7a /vendor/github.com/yuin/goldmark/renderer/html/html.go | |
parent | [bugfix] Fix filter title unique constraint (#3458) (diff) | |
download | gotosocial-ea1bf5f8a37992aa547573a42332235dc7142399.tar.xz |
[chore]: Bump github.com/yuin/goldmark from 1.7.6 to 1.7.8 (#3470)
Bumps [github.com/yuin/goldmark](https://github.com/yuin/goldmark) from 1.7.6 to 1.7.8.
- [Release notes](https://github.com/yuin/goldmark/releases)
- [Commits](https://github.com/yuin/goldmark/compare/v1.7.6...v1.7.8)
---
updated-dependencies:
- dependency-name: github.com/yuin/goldmark
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Diffstat (limited to 'vendor/github.com/yuin/goldmark/renderer/html/html.go')
-rw-r--r-- | vendor/github.com/yuin/goldmark/renderer/html/html.go | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/vendor/github.com/yuin/goldmark/renderer/html/html.go b/vendor/github.com/yuin/goldmark/renderer/html/html.go index 9ebd0a371..aac8d2dd7 100644 --- a/vendor/github.com/yuin/goldmark/renderer/html/html.go +++ b/vendor/github.com/yuin/goldmark/renderer/html/html.go @@ -680,7 +680,7 @@ func (r *Renderer) renderImage(w util.BufWriter, source []byte, node ast.Node, e _, _ = w.Write(util.EscapeHTML(util.URLEscape(n.Destination, true))) } _, _ = w.WriteString(`" alt="`) - r.renderAttribute(w, source, n) + r.renderTexts(w, source, n) _ = w.WriteByte('"') if n.Title != nil { _, _ = w.WriteString(` title="`) @@ -737,7 +737,7 @@ func (r *Renderer) renderText(w util.BufWriter, source []byte, node ast.Node, en if r.EastAsianLineBreaks != 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) if r.EastAsianLineBreaks.softLineBreak(thisLastRune, siblingFirstRune) { @@ -770,19 +770,14 @@ func (r *Renderer) renderString(w util.BufWriter, source []byte, node ast.Node, return ast.WalkContinue, nil } -func (r *Renderer) renderAttribute(w util.BufWriter, source []byte, n ast.Node) { +func (r *Renderer) renderTexts(w util.BufWriter, source []byte, n ast.Node) { for c := n.FirstChild(); c != nil; c = c.NextSibling() { if s, ok := c.(*ast.String); ok { _, _ = r.renderString(w, source, s, true) - } else if t, ok := c.(*ast.String); ok { + } else if t, ok := c.(*ast.Text); ok { _, _ = r.renderText(w, source, t, true) - } else if !c.HasChildren() { - r.Writer.Write(w, c.Text(source)) - if t, ok := c.(*ast.Text); ok && t.SoftLineBreak() { - _ = w.WriteByte('\n') - } } else { - r.renderAttribute(w, source, c) + r.renderTexts(w, source, c) } } } |