aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/yuin
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-11-06 19:41:42 +0100
committerGitHub <noreply@github.com>2020-11-06 13:41:42 -0500
commit30ce3731a17913155436cee323b1e7016ad8eb49 (patch)
treed03230684af7dfcfff7705ac547a35b3089f02fb /vendor/github.com/yuin
parenteebaa81f43a6fd982dcd96571a020242f0ea3276 (diff)
downloadgitea-30ce3731a17913155436cee323b1e7016ad8eb49.tar.gz
gitea-30ce3731a17913155436cee323b1e7016ad8eb49.zip
Vendor Update Go Libs (#13444)
* denisenkom/go-mssqldb untagged -> v0.9.0 * github.com/editorconfig/editorconfig-core-go v2.3.7 -> v2.3.8 * github.com/go-testfixtures/testfixtures v3.4.0 -> v3.4.1 * github.com/mholt/archiver v3.3.2 -> v3.5.0 * github.com/olivere/elastic v7.0.20 -> v7.0.21 * github.com/urfave/cli v1.22.4 -> v1.22.5 * github.com/xanzy/go-gitlab v0.38.1 -> v0.39.0 * github.com/yuin/goldmark-meta untagged -> v1.0.0 * github.com/ethantkoenig/rupture 0a76f03a811a -> c3b3b810dc77 * github.com/jaytaylor/html2text 8fb95d837f7d -> 3577fbdbcff7 * github.com/kballard/go-shellquote cd60e84ee657 -> 95032a82bc51 * github.com/msteinert/pam 02ccfbfaf0cc -> 913b8f8cdf8b * github.com/unknwon/paginater 7748a72e0141 -> 042474bd0eae * CI.restart() Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'vendor/github.com/yuin')
-rw-r--r--vendor/github.com/yuin/goldmark-meta/README.md5
-rw-r--r--vendor/github.com/yuin/goldmark-meta/go.mod6
-rw-r--r--vendor/github.com/yuin/goldmark-meta/go.sum4
-rw-r--r--vendor/github.com/yuin/goldmark-meta/meta.go32
4 files changed, 43 insertions, 4 deletions
diff --git a/vendor/github.com/yuin/goldmark-meta/README.md b/vendor/github.com/yuin/goldmark-meta/README.md
index 98f926b350..234ce0fb59 100644
--- a/vendor/github.com/yuin/goldmark-meta/README.md
+++ b/vendor/github.com/yuin/goldmark-meta/README.md
@@ -1,5 +1,10 @@
goldmark-meta
=========================
+[![GoDev][godev-image]][godev-url]
+
+[godev-image]: https://pkg.go.dev/badge/github.com/yuin/goldmark-meta
+[godev-url]: https://pkg.go.dev/github.com/yuin/goldmark-meta
+
goldmark-meta is an extension for the [goldmark](http://github.com/yuin/goldmark)
that allows you to define document metadata in YAML format.
diff --git a/vendor/github.com/yuin/goldmark-meta/go.mod b/vendor/github.com/yuin/goldmark-meta/go.mod
index b5496c1757..d5055a05db 100644
--- a/vendor/github.com/yuin/goldmark-meta/go.mod
+++ b/vendor/github.com/yuin/goldmark-meta/go.mod
@@ -1,8 +1,8 @@
module github.com/yuin/goldmark-meta
-go 1.13
+go 1.15
require (
- github.com/yuin/goldmark v1.1.7
- gopkg.in/yaml.v2 v2.2.2
+ github.com/yuin/goldmark v1.2.1
+ gopkg.in/yaml.v2 v2.3.0
)
diff --git a/vendor/github.com/yuin/goldmark-meta/go.sum b/vendor/github.com/yuin/goldmark-meta/go.sum
index 7cd925cd55..c83ca26fe1 100644
--- a/vendor/github.com/yuin/goldmark-meta/go.sum
+++ b/vendor/github.com/yuin/goldmark-meta/go.sum
@@ -1,6 +1,10 @@
github.com/yuin/goldmark v1.1.7 h1:XiwWADvxJeIM1JbXqthrEhDc19hTMui+o+QaY1hGXlk=
github.com/yuin/goldmark v1.1.7/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
+github.com/yuin/goldmark v1.2.1 h1:ruQGxdhGHe7FWOJPT0mKs5+pD2Xs1Bm/kdGlHO04FmM=
+github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
+gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
diff --git a/vendor/github.com/yuin/goldmark-meta/meta.go b/vendor/github.com/yuin/goldmark-meta/meta.go
index 2860437136..7850e5cbd1 100644
--- a/vendor/github.com/yuin/goldmark-meta/meta.go
+++ b/vendor/github.com/yuin/goldmark-meta/meta.go
@@ -7,6 +7,7 @@ package meta
import (
"bytes"
"fmt"
+
"github.com/yuin/goldmark"
gast "github.com/yuin/goldmark/ast"
east "github.com/yuin/goldmark/extension/ast"
@@ -36,6 +37,20 @@ func Get(pc parser.Context) map[string]interface{} {
return d.Map
}
+// TryGet tries to get a YAML metadata.
+// If there are YAML parsing errors, then nil and error are returned
+func TryGet(pc parser.Context) (map[string]interface{}, error) {
+ dtmp := pc.Get(contextKey)
+ if dtmp == nil {
+ return nil, nil
+ }
+ d := dtmp.(*data)
+ if d.Error != nil {
+ return nil, d.Error
+ }
+ return d.Map, nil
+}
+
// GetItems returns a YAML metadata.
// GetItems preserves defined key order.
func GetItems(pc parser.Context) yaml.MapSlice {
@@ -47,6 +62,21 @@ func GetItems(pc parser.Context) yaml.MapSlice {
return d.Items
}
+// TryGetItems returns a YAML metadata.
+// TryGetItems preserves defined key order.
+// If there are YAML parsing errors, then nil and erro are returned.
+func TryGetItems(pc parser.Context) (yaml.MapSlice, error) {
+ dtmp := pc.Get(contextKey)
+ if dtmp == nil {
+ return nil, nil
+ }
+ d := dtmp.(*data)
+ if d.Error != nil {
+ return nil, d.Error
+ }
+ return d.Items, nil
+}
+
type metaParser struct {
}
@@ -85,7 +115,7 @@ func (b *metaParser) Open(parent gast.Node, reader text.Reader, pc parser.Contex
func (b *metaParser) Continue(node gast.Node, reader text.Reader, pc parser.Context) parser.State {
line, segment := reader.PeekLine()
- if isSeparator(line) {
+ if isSeparator(line) && !util.IsBlank(line) {
reader.Advance(segment.Len())
return parser.Close
}