File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ func main() {
3333 out .WriteString ("// Use 'go generate ./commands' to update\n " )
3434 fileregex := regexp .MustCompile (`git-lfs(?:-([A-Za-z\-]+))?.\d.ronn` )
3535 headerregex := regexp .MustCompile (`^###?\s+([A-Za-z0-9 ]+)` )
36+ // only pick up caps in links to avoid matching optional args
37+ linkregex := regexp .MustCompile (`\[([A-Z\- ]+)\]` )
3638 count := 0
3739 for _ , f := range fs {
3840 if match := fileregex .FindStringSubmatch (f .Name ()); match != nil {
@@ -85,6 +87,11 @@ func main() {
8587 firstHeaderDone = true
8688 lastLineWasBullet = false
8789 continue
90+ } else if lmatches := linkregex .FindAllStringSubmatch (line , - 1 ); lmatches != nil {
91+ for _ , lmatch := range lmatches {
92+ linktext := strings .ToLower (lmatch [1 ])
93+ line = strings .Replace (line , lmatch [0 ], `"` + strings .ToUpper (linktext [:1 ])+ linktext [1 :]+ `"` , 1 )
94+ }
8895 }
8996 // Skip content until after first header
9097 if ! firstHeaderDone {
You can’t perform that action at this time.
0 commit comments