Skip to content

Commit

Permalink
fix issue in gstr.Nl2Br (gogf#2028)
Browse files Browse the repository at this point in the history
  • Loading branch information
gqcn authored Jul 25, 2022
1 parent 390b936 commit e00d3ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion text/gstr/gstr_convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func Nl2Br(str string, isXhtml ...bool) string {
}
switch v {
case n, r:
if (i+1 < length) && (v == r && runes[i+1] == n) || (v == n && runes[i+1] == r) {
if (i+1 < length) && ((v == r && runes[i+1] == n) || (v == n && runes[i+1] == r)) {
buf.Write(br)
skip = true
continue
Expand Down

0 comments on commit e00d3ff

Please sign in to comment.