Tcl Library Source Code

Artifact [c4d3b93d89]
Login
EuroTcl/OpenACS 11 - 12 JULY 2024, VIENNA

Artifact c4d3b93d89b013d5cac8cdc245352e6ed82fb612:

Attachment "1742078.patch" to ticket [1742078fff] added by anonymous 2014-03-18 15:16:51. (unpublished)
diff -uprN ./orig/html.tcl ./new/html.tcl
--- ./orig/html.tcl	2014-03-18 13:24:13.000000000 +0200
+++ ./new/html.tcl	2014-03-18 16:05:22.054472704 +0200
@@ -1405,7 +1405,7 @@ proc ::html::html_entities {s} {
 #	The text with <br> in place of line-endings.
 
 proc ::html::nl2br {s} {
-    return [string map [list \n\r <br> \n <br> \r <br>] $s]
+    return [string map [list \n\r <br> \r\n <br> \n <br> \r <br>] $s]
 }
 
 # ::html::doctype
diff -uprN ./orig/html.test ./new/html.test
--- ./orig/html.test	2014-03-14 23:38:00.000000000 +0200
+++ ./new/html.test	2014-03-18 16:02:39.382474434 +0200
@@ -829,10 +829,12 @@ test html-33.1 {html::font} {
     html::font size=18
 } {<font size=18>}
 
-
 test html-34.0 {html::nl2br} {
     html::nl2br "a\n\rb\nc\rd"
 } {a<br>b<br>c<br>d}
 
+test html-34.1 {html::nl2br test to catch #1742078} {
+    html::nl2br "a\r\nb"
+} {a<br>b}
 
 testsuiteCleanup