summaryrefslogtreecommitdiff
path: root/vendor/github.com/yuin/goldmark/ast/block.go
diff options
context:
space:
mode:
authorLibravatar dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2024-10-21 11:37:00 +0200
committerLibravatar GitHub <noreply@github.com>2024-10-21 11:37:00 +0200
commitea1bf5f8a37992aa547573a42332235dc7142399 (patch)
tree9f89eabc416ec6339f02d4092182e055a8227f7a /vendor/github.com/yuin/goldmark/ast/block.go
parent[bugfix] Fix filter title unique constraint (#3458) (diff)
downloadgotosocial-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/ast/block.go')
-rw-r--r--vendor/github.com/yuin/goldmark/ast/block.go49
1 files changed, 39 insertions, 10 deletions
diff --git a/vendor/github.com/yuin/goldmark/ast/block.go b/vendor/github.com/yuin/goldmark/ast/block.go
index 04d0d5443..eae7acdca 100644
--- a/vendor/github.com/yuin/goldmark/ast/block.go
+++ b/vendor/github.com/yuin/goldmark/ast/block.go
@@ -1,7 +1,6 @@
package ast
import (
- "bytes"
"fmt"
"strings"
@@ -48,15 +47,6 @@ func (b *BaseBlock) SetLines(v *textm.Segments) {
b.lines = v
}
-// Text implements Node.Text.
-func (b *BaseBlock) Text(source []byte) []byte {
- var buf bytes.Buffer
- for _, line := range b.Lines().Sliced(0, b.Lines().Len()) {
- buf.Write(line.Value(source))
- }
- return buf.Bytes()
-}
-
// A Document struct is a root node of Markdown text.
type Document struct {
BaseBlock
@@ -140,6 +130,13 @@ func (n *TextBlock) Kind() NodeKind {
return KindTextBlock
}
+// Text implements Node.Text.
+//
+// Deprecated: Use other properties of the node to get the text value(i.e. TextBlock.Lines).
+func (n *TextBlock) Text(source []byte) []byte {
+ return n.Lines().Value(source)
+}
+
// NewTextBlock returns a new TextBlock node.
func NewTextBlock() *TextBlock {
return &TextBlock{
@@ -165,6 +162,13 @@ func (n *Paragraph) Kind() NodeKind {
return KindParagraph
}
+// Text implements Node.Text.
+//
+// Deprecated: Use other properties of the node to get the text value(i.e. Paragraph.Lines).
+func (n *Paragraph) Text(source []byte) []byte {
+ return n.Lines().Value(source)
+}
+
// NewParagraph returns a new Paragraph node.
func NewParagraph() *Paragraph {
return &Paragraph{
@@ -259,6 +263,13 @@ func (n *CodeBlock) Kind() NodeKind {
return KindCodeBlock
}
+// Text implements Node.Text.
+//
+// Deprecated: Use other properties of the node to get the text value(i.e. CodeBlock.Lines).
+func (n *CodeBlock) Text(source []byte) []byte {
+ return n.Lines().Value(source)
+}
+
// NewCodeBlock returns a new CodeBlock node.
func NewCodeBlock() *CodeBlock {
return &CodeBlock{
@@ -314,6 +325,13 @@ func (n *FencedCodeBlock) Kind() NodeKind {
return KindFencedCodeBlock
}
+// Text implements Node.Text.
+//
+// Deprecated: Use other properties of the node to get the text value(i.e. FencedCodeBlock.Lines).
+func (n *FencedCodeBlock) Text(source []byte) []byte {
+ return n.Lines().Value(source)
+}
+
// NewFencedCodeBlock return a new FencedCodeBlock node.
func NewFencedCodeBlock(info *Text) *FencedCodeBlock {
return &FencedCodeBlock{
@@ -508,6 +526,17 @@ func (n *HTMLBlock) Kind() NodeKind {
return KindHTMLBlock
}
+// Text implements Node.Text.
+//
+// Deprecated: Use other properties of the node to get the text value(i.e. HTMLBlock.Lines).
+func (n *HTMLBlock) Text(source []byte) []byte {
+ ret := n.Lines().Value(source)
+ if n.HasClosure() {
+ ret = append(ret, n.ClosureLine.Value(source)...)
+ }
+ return ret
+}
+
// NewHTMLBlock returns a new HTMLBlock node.
func NewHTMLBlock(typ HTMLBlockType) *HTMLBlock {
return &HTMLBlock{