diff --git a/test/tools/go.mod b/test/tools/go.mod index c1a9e3eeec..6ffb35b558 100644 --- a/test/tools/go.mod +++ b/test/tools/go.mod @@ -3,7 +3,7 @@ module github.com/containers/podman/test/tools go 1.18 require ( - github.com/cpuguy83/go-md2man/v2 v2.0.2 + github.com/cpuguy83/go-md2man/v2 v2.0.3 github.com/onsi/ginkgo/v2 v2.13.0 github.com/vbatts/git-validation v1.2.0 golang.org/x/tools v0.14.0 diff --git a/test/tools/go.sum b/test/tools/go.sum index c6b0f1aa06..e7620776cb 100644 --- a/test/tools/go.sum +++ b/test/tools/go.sum @@ -1,8 +1,8 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= diff --git a/test/tools/vendor/github.com/cpuguy83/go-md2man/v2/.golangci.yml b/test/tools/vendor/github.com/cpuguy83/go-md2man/v2/.golangci.yml new file mode 100644 index 0000000000..71f073f3c6 --- /dev/null +++ b/test/tools/vendor/github.com/cpuguy83/go-md2man/v2/.golangci.yml @@ -0,0 +1,6 @@ +# For documentation, see https://golangci-lint.run/usage/configuration/ + +linters: + enable: + - gofumpt + diff --git a/test/tools/vendor/github.com/cpuguy83/go-md2man/v2/go-md2man.1.md b/test/tools/vendor/github.com/cpuguy83/go-md2man/v2/go-md2man.1.md index 16d1133aa1..aa4587e279 100644 --- a/test/tools/vendor/github.com/cpuguy83/go-md2man/v2/go-md2man.1.md +++ b/test/tools/vendor/github.com/cpuguy83/go-md2man/v2/go-md2man.1.md @@ -2,22 +2,27 @@ go-md2man 1 "January 2015" go-md2man "User Manual" ================================================== # NAME - go-md2man - Convert markdown files into manpages +go-md2man - Convert markdown files into manpages # SYNOPSIS - go-md2man -in=[/path/to/md/file] -out=[/path/to/output] +**go-md2man** [**-in**=*/path/to/md/file*] [**-out**=*/path/to/output*] -# Description - go-md2man converts standard markdown formatted documents into manpages. It is - written purely in Go so as to reduce dependencies on 3rd party libs. +# DESCRIPTION +**go-md2man** converts standard markdown formatted documents into manpages. It is +written purely in Go so as to reduce dependencies on 3rd party libs. - By default, the input is stdin and the output is stdout. +By default, the input is stdin and the output is stdout. -# Example - Convert the markdown file "go-md2man.1.md" into a manpage. +# EXAMPLES +Convert the markdown file *go-md2man.1.md* into a manpage: +``` +go-md2man < go-md2man.1.md > go-md2man.1 +``` - go-md2man -in=go-md2man.1.md -out=go-md2man.1.out +Same, but using command line arguments instead of shell redirection: +``` +go-md2man -in=go-md2man.1.md -out=go-md2man.1 +``` # HISTORY - January 2015, Originally compiled by Brian Goff( cpuguy83@gmail.com ) - +January 2015, Originally compiled by Brian Goff (cpuguy83@gmail.com). diff --git a/test/tools/vendor/github.com/cpuguy83/go-md2man/v2/md2man.go b/test/tools/vendor/github.com/cpuguy83/go-md2man/v2/md2man.go index 6078864a3c..4ff873b8e7 100644 --- a/test/tools/vendor/github.com/cpuguy83/go-md2man/v2/md2man.go +++ b/test/tools/vendor/github.com/cpuguy83/go-md2man/v2/md2man.go @@ -9,8 +9,10 @@ import ( "github.com/cpuguy83/go-md2man/v2/md2man" ) -var inFilePath = flag.String("in", "", "Path to file to be processed (default: stdin)") -var outFilePath = flag.String("out", "", "Path to output processed file (default: stdout)") +var ( + inFilePath = flag.String("in", "", "Path to file to be processed (default: stdin)") + outFilePath = flag.String("out", "", "Path to output processed file (default: stdout)") +) func main() { var err error diff --git a/test/tools/vendor/github.com/cpuguy83/go-md2man/v2/md2man/md2man.go b/test/tools/vendor/github.com/cpuguy83/go-md2man/v2/md2man/md2man.go index b480056734..42bf32aab0 100644 --- a/test/tools/vendor/github.com/cpuguy83/go-md2man/v2/md2man/md2man.go +++ b/test/tools/vendor/github.com/cpuguy83/go-md2man/v2/md2man/md2man.go @@ -9,6 +9,8 @@ func Render(doc []byte) []byte { renderer := NewRoffRenderer() return blackfriday.Run(doc, - []blackfriday.Option{blackfriday.WithRenderer(renderer), - blackfriday.WithExtensions(renderer.GetExtensions())}...) + []blackfriday.Option{ + blackfriday.WithRenderer(renderer), + blackfriday.WithExtensions(renderer.GetExtensions()), + }...) } diff --git a/test/tools/vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go b/test/tools/vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go index be2b343606..4b19188d90 100644 --- a/test/tools/vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go +++ b/test/tools/vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go @@ -1,6 +1,7 @@ package md2man import ( + "bytes" "fmt" "io" "os" @@ -34,10 +35,10 @@ const ( hruleTag = "\n.ti 0\n\\l'\\n(.lu'\n" linkTag = "\n\\[la]" linkCloseTag = "\\[ra]" - codespanTag = "\\fB\\fC" + codespanTag = "\\fB" codespanCloseTag = "\\fR" - codeTag = "\n.PP\n.RS\n\n.nf\n" - codeCloseTag = "\n.fi\n.RE\n" + codeTag = "\n.EX\n" + codeCloseTag = "\n.EE\n" quoteTag = "\n.PP\n.RS\n" quoteCloseTag = "\n.RE\n" listTag = "\n.RS\n" @@ -86,8 +87,7 @@ func (r *roffRenderer) RenderFooter(w io.Writer, ast *blackfriday.Node) { // RenderNode is called for each node in a markdown document; based on the node // type the equivalent roff output is sent to the writer func (r *roffRenderer) RenderNode(w io.Writer, node *blackfriday.Node, entering bool) blackfriday.WalkStatus { - - var walkAction = blackfriday.GoToNext + walkAction := blackfriday.GoToNext switch node.Type { case blackfriday.Text: @@ -109,9 +109,16 @@ func (r *roffRenderer) RenderNode(w io.Writer, node *blackfriday.Node, entering out(w, strongCloseTag) } case blackfriday.Link: - if !entering { - out(w, linkTag+string(node.LinkData.Destination)+linkCloseTag) + // Don't render the link text for automatic links, because this + // will only duplicate the URL in the roff output. + // See https://daringfireball.net/projects/markdown/syntax#autolink + if !bytes.Equal(node.LinkData.Destination, node.FirstChild.Literal) { + out(w, string(node.FirstChild.Literal)) } + // Hyphens in a link must be escaped to avoid word-wrap in the rendered man page. + escapedLink := strings.ReplaceAll(string(node.LinkData.Destination), "-", "\\-") + out(w, linkTag+escapedLink+linkCloseTag) + walkAction = blackfriday.SkipChildren case blackfriday.Image: // ignore images walkAction = blackfriday.SkipChildren @@ -160,6 +167,11 @@ func (r *roffRenderer) RenderNode(w io.Writer, node *blackfriday.Node, entering r.handleTableCell(w, node, entering) case blackfriday.HTMLSpan: // ignore other HTML tags + case blackfriday.HTMLBlock: + if bytes.HasPrefix(node.Literal, []byte("