Tcl Library Source Code

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

Artifact e4e770ebcb999c0ace2fbc15c0a0ef7fe1ea2f80:

Attachment "afe4366e2ea71590f59f2aeee9ee52a34b1f05d2.patch" to ticket [afe4366e2e] added by anonymous 2014-03-18 15:17:13. (unpublished)
diff -uprN ./orig/html.man ./new/html.man
--- ./orig/html.man	2014-03-14 23:38:00.000000000 +0200
+++ ./new/html.man	2014-03-18 17:14:43.014428474 +0200
@@ -401,6 +401,25 @@ structure.  Rather than evaluating the b
 [arg body].  Each iteration of the loop causes another string to be
 concatenated to the result value.
 
+[call [cmd ::html::doctype] [arg arg]
+
+This procedure can be used to build the standard DOCTYPE declaration 
+string. It will return the standard declaration string or an error if the id is not found.
+The following standard ID's are defined:
+
+HTML32
+HTML40
+HTML40T
+HTML40F
+HTML401
+HTML401T
+HTML401F
+XHTML10S
+XHTML10T
+XHTML10F
+XHTML11
+XHTMLB  
+
 [list_end]
 
 [vset CATEGORY html]
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 17:05:57.430434061 +0200
@@ -1419,9 +1419,9 @@ proc ::html::nl2br {s} {
 
 proc ::html::doctype {arg} {
     variable doctypes
-    set code [string toupper $arg]
-    if {![info exists doctypes($code)]} {
-	return -code error "Unknown doctype \"$arg\""
+    ::set code [string toupper $arg]
+    ::if {![info exists doctypes($code)]} {
+	    return -code error "Unknown doctype \"$arg\""
     }
     return $doctypes($code)
 }
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 17:08:35.326432383 +0200
@@ -834,5 +834,8 @@ test html-34.0 {html::nl2br} {
     html::nl2br "a\n\rb\nc\rd"
 } {a<br>b<br>c<br>d}
 
+test html-37.0 {html::doctype test to catch #afe4366e2ea71590f59f2aeee9ee52a34b1f05d2} {
+    catch { html::doctype HTML401T } msg
+} 0
 
 testsuiteCleanup