summaryrefslogtreecommitdiff
path: root/vendor/github.com/yuin/goldmark/extension
diff options
context:
space:
mode:
authorLibravatar dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2024-02-05 09:50:35 +0000
committerLibravatar GitHub <noreply@github.com>2024-02-05 09:50:35 +0000
commita482cb59f2c9e29c133c4b864cc1e32af1fb99a7 (patch)
tree65778a279d5aa84d53f1a997a958e8f42c64e981 /vendor/github.com/yuin/goldmark/extension
parent[chore] bump activity dependency -> v1.6.0-gts (#2599) (diff)
downloadgotosocial-a482cb59f2c9e29c133c4b864cc1e32af1fb99a7.tar.xz
[chore]: Bump github.com/yuin/goldmark from 1.6.0 to 1.7.0 (#2603)
Diffstat (limited to 'vendor/github.com/yuin/goldmark/extension')
-rw-r--r--vendor/github.com/yuin/goldmark/extension/footnote.go24
-rw-r--r--vendor/github.com/yuin/goldmark/extension/linkify.go8
-rw-r--r--vendor/github.com/yuin/goldmark/extension/typographer.go4
3 files changed, 19 insertions, 17 deletions
diff --git a/vendor/github.com/yuin/goldmark/extension/footnote.go b/vendor/github.com/yuin/goldmark/extension/footnote.go
index d1b67aa77..2e225269c 100644
--- a/vendor/github.com/yuin/goldmark/extension/footnote.go
+++ b/vendor/github.com/yuin/goldmark/extension/footnote.go
@@ -382,8 +382,8 @@ func (o *withFootnoteIDPrefix) SetFootnoteOption(c *FootnoteConfig) {
}
// WithFootnoteIDPrefix is a functional option that is a prefix for the id attributes generated by footnotes.
-func WithFootnoteIDPrefix(a []byte) FootnoteOption {
- return &withFootnoteIDPrefix{a}
+func WithFootnoteIDPrefix[T []byte | string](a T) FootnoteOption {
+ return &withFootnoteIDPrefix{[]byte(a)}
}
const optFootnoteIDPrefixFunction renderer.OptionName = "FootnoteIDPrefixFunction"
@@ -420,8 +420,8 @@ func (o *withFootnoteLinkTitle) SetFootnoteOption(c *FootnoteConfig) {
}
// WithFootnoteLinkTitle is a functional option that is an optional title attribute for footnote links.
-func WithFootnoteLinkTitle(a []byte) FootnoteOption {
- return &withFootnoteLinkTitle{a}
+func WithFootnoteLinkTitle[T []byte | string](a T) FootnoteOption {
+ return &withFootnoteLinkTitle{[]byte(a)}
}
const optFootnoteBacklinkTitle renderer.OptionName = "FootnoteBacklinkTitle"
@@ -439,8 +439,8 @@ func (o *withFootnoteBacklinkTitle) SetFootnoteOption(c *FootnoteConfig) {
}
// WithFootnoteBacklinkTitle is a functional option that is an optional title attribute for footnote backlinks.
-func WithFootnoteBacklinkTitle(a []byte) FootnoteOption {
- return &withFootnoteBacklinkTitle{a}
+func WithFootnoteBacklinkTitle[T []byte | string](a T) FootnoteOption {
+ return &withFootnoteBacklinkTitle{[]byte(a)}
}
const optFootnoteLinkClass renderer.OptionName = "FootnoteLinkClass"
@@ -458,8 +458,8 @@ func (o *withFootnoteLinkClass) SetFootnoteOption(c *FootnoteConfig) {
}
// WithFootnoteLinkClass is a functional option that is a class for footnote links.
-func WithFootnoteLinkClass(a []byte) FootnoteOption {
- return &withFootnoteLinkClass{a}
+func WithFootnoteLinkClass[T []byte | string](a T) FootnoteOption {
+ return &withFootnoteLinkClass{[]byte(a)}
}
const optFootnoteBacklinkClass renderer.OptionName = "FootnoteBacklinkClass"
@@ -477,8 +477,8 @@ func (o *withFootnoteBacklinkClass) SetFootnoteOption(c *FootnoteConfig) {
}
// WithFootnoteBacklinkClass is a functional option that is a class for footnote backlinks.
-func WithFootnoteBacklinkClass(a []byte) FootnoteOption {
- return &withFootnoteBacklinkClass{a}
+func WithFootnoteBacklinkClass[T []byte | string](a T) FootnoteOption {
+ return &withFootnoteBacklinkClass{[]byte(a)}
}
const optFootnoteBacklinkHTML renderer.OptionName = "FootnoteBacklinkHTML"
@@ -496,8 +496,8 @@ func (o *withFootnoteBacklinkHTML) SetFootnoteOption(c *FootnoteConfig) {
}
// WithFootnoteBacklinkHTML is an HTML content for footnote backlinks.
-func WithFootnoteBacklinkHTML(a []byte) FootnoteOption {
- return &withFootnoteBacklinkHTML{a}
+func WithFootnoteBacklinkHTML[T []byte | string](a T) FootnoteOption {
+ return &withFootnoteBacklinkHTML{[]byte(a)}
}
// FootnoteHTMLRenderer is a renderer.NodeRenderer implementation that
diff --git a/vendor/github.com/yuin/goldmark/extension/linkify.go b/vendor/github.com/yuin/goldmark/extension/linkify.go
index 0f23e907d..ad88933ac 100644
--- a/vendor/github.com/yuin/goldmark/extension/linkify.go
+++ b/vendor/github.com/yuin/goldmark/extension/linkify.go
@@ -66,10 +66,12 @@ func (o *withLinkifyAllowedProtocols) SetLinkifyOption(p *LinkifyConfig) {
// WithLinkifyAllowedProtocols is a functional option that specify allowed
// protocols in autolinks. Each protocol must end with ':' like
// 'http:' .
-func WithLinkifyAllowedProtocols(value [][]byte) LinkifyOption {
- return &withLinkifyAllowedProtocols{
- value: value,
+func WithLinkifyAllowedProtocols[T []byte | string](value []T) LinkifyOption {
+ opt := &withLinkifyAllowedProtocols{}
+ for _, v := range value {
+ opt.value = append(opt.value, []byte(v))
}
+ return opt
}
type withLinkifyURLRegexp struct {
diff --git a/vendor/github.com/yuin/goldmark/extension/typographer.go b/vendor/github.com/yuin/goldmark/extension/typographer.go
index 259c4f72f..44c15ebf1 100644
--- a/vendor/github.com/yuin/goldmark/extension/typographer.go
+++ b/vendor/github.com/yuin/goldmark/extension/typographer.go
@@ -115,10 +115,10 @@ func (o *withTypographicSubstitutions) SetTypographerOption(p *TypographerConfig
// WithTypographicSubstitutions is a functional otpion that specify replacement text
// for punctuations.
-func WithTypographicSubstitutions(values map[TypographicPunctuation][]byte) TypographerOption {
+func WithTypographicSubstitutions[T []byte | string](values map[TypographicPunctuation]T) TypographerOption {
replacements := newDefaultSubstitutions()
for k, v := range values {
- replacements[k] = v
+ replacements[k] = []byte(v)
}
return &withTypographicSubstitutions{replacements}