diff --git a/internal/markdown/comment.go b/internal/markdown/comment.go index 3edfdca..af21449 100644 --- a/internal/markdown/comment.go +++ b/internal/markdown/comment.go @@ -39,7 +39,7 @@ const ( urlRx = protoPart + `://` + hostPart + pathPart // Regexp for local paths - localRx = `\.\/[^\s]+` + localRx = `\.\/[a-zA-Z0-9_@\-\.\/]*` ) var matchRx = regexp.MustCompile(`(` + urlTitle + `((` + urlRx + `)|(` + localRx + `)))|(` + identRx + `)`) diff --git a/testdata/pkg1/README.md b/testdata/pkg1/README.md index 5981037..3847ea5 100644 --- a/testdata/pkg1/README.md +++ b/testdata/pkg1/README.md @@ -14,6 +14,7 @@ A local link should just start with period and slash: [./internal](./internal), A web page link should just be written as is: [https://goreadme.herokuapp.com](https://goreadme.herokuapp.com), and with path: [https://goreadme.herokuapp.com/projects](https://goreadme.herokuapp.com/projects). A url can also have a [title](http://example.org). A local path can also have a [title](./pkg.go). +A local path in inline code `go test [./](./)`. #### Another Section Header diff --git a/testdata/pkg1/pkg1.go b/testdata/pkg1/pkg1.go index 9444f5b..988eae9 100644 --- a/testdata/pkg1/pkg1.go +++ b/testdata/pkg1/pkg1.go @@ -12,6 +12,7 @@ // A web page link should just be written as is: https://goreadme.herokuapp.com, and with path: https://goreadme.herokuapp.com/projects. // A url can also have a (title) http://example.org. // A local path can also have a (title) ./pkg.go. +// A local path in inline code `go test ./`. // // Another Section Header //