Skip to content

Commit

Permalink
fix cases that last line does not end with \n
Browse files Browse the repository at this point in the history
  • Loading branch information
posener committed Apr 13, 2019
1 parent 87780d4 commit 5a4f9df
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/markdown/comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ func pairedParensPrefixLen(s string) int {
// the corresponding map value is not the empty string, it is considered a URL
// and the word is converted into a link.
func emphasize(w io.Writer, line string, words map[string]string, nice bool) {
if line[len(line)-1] != '\n' {
line = line + "\n"
}
for {
m := matchRx.FindStringSubmatchIndex(line)
if m == nil {
Expand Down

0 comments on commit 5a4f9df

Please sign in to comment.