Skip to content

Commit 8016ac3

Browse files
OleksandrOmelchenkokvz
authored andcommitted
Remove useless regex part (locutusjs#326)
What was even the point of that regex part? :)
1 parent 60fb2ef commit 8016ac3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/php/strings/nl2br.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ module.exports = function nl2br (str, isXhtml) {
2828
var breakTag = (isXhtml || typeof isXhtml === 'undefined') ? '<br ' + '/>' : '<br>'
2929

3030
return (str + '')
31-
.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + breakTag + '$2')
31+
.replace(/(\r\n|\n\r|\r|\n)/g, breakTag + '$1')
3232
}

0 commit comments

Comments
 (0)