Skip to content

Commit

Permalink
Merge pull request #116 from posener/special-symbols
Browse files Browse the repository at this point in the history
Special symbols
  • Loading branch information
posener authored Jul 8, 2021
2 parents 22a7303 + c21ef99 commit 95f44dc
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
10 changes: 5 additions & 5 deletions internal/markdown/comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func emphasize(w io.Writer, line string, words map[string]string, nice bool) {
// m >= 6 (two parenthesized sub-regexps in matchRx, 1st one is urlRx)

// write text before match
fmt.Fprintf(w, line[0:m[0]])
fmt.Fprint(w, line[0:m[0]])
// adjust match if necessary
match := line[m[0]:m[1]]
if n := pairedParensPrefixLen(match); n < len(match) {
Expand Down Expand Up @@ -197,7 +197,7 @@ func emphasize(w io.Writer, line string, words map[string]string, nice bool) {

// Skip Go path ellipsis.
if strings.HasSuffix(url, "/...") {
fmt.Fprintf(w, line[1:m[1]])
fmt.Fprint(w, line[1:m[1]])
line = line[m[1]:]
continue
}
Expand Down Expand Up @@ -228,9 +228,9 @@ func emphasize(w io.Writer, line string, words map[string]string, nice bool) {
fmt.Fprint(w, "*")
}
if len(url) > 0 {
fmt.Fprintf(w, url)
fmt.Fprint(w, url)
} else {
fmt.Fprintf(w, match)
fmt.Fprint(w, match)
}
if italics {
fmt.Fprint(w, "*")
Expand All @@ -243,7 +243,7 @@ func emphasize(w io.Writer, line string, words map[string]string, nice bool) {
// advance
line = line[m[1]:]
}
fmt.Fprintf(w, line)
fmt.Fprint(w, line)
}

func indentLen(s string) int {
Expand Down
5 changes: 5 additions & 0 deletions testdata/pkg12_special_symbols/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# pkg12

Package pkg12 tests special symbols

This is issue #115: %
3 changes: 3 additions & 0 deletions testdata/pkg12_special_symbols/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module pkg1

go 1.13
4 changes: 4 additions & 0 deletions testdata/pkg12_special_symbols/pkg12.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Package pkg12 tests special symbols
//
// This is issue #115: %
package pkg12

0 comments on commit 95f44dc

Please sign in to comment.