Tk Library Source Code

Artifact [415194af6c]
Login

Artifact 415194af6c838cc6c6a36f056af0478d342bb7b6:

Attachment "htmlparse-ncr0.patch" to ticket [1039961fff] added by jenglish 2004-10-04 21:28:30.
Index: htmlparse.tcl
===================================================================
RCS file: /cvsroot/tcllib/tcllib/modules/htmlparse/htmlparse.tcl,v
retrieving revision 1.19
diff -u -r1.19 htmlparse.tcl
--- htmlparse.tcl	3 Oct 2004 23:06:56 -0000	1.19
+++ htmlparse.tcl	4 Oct 2004 14:22:15 -0000
@@ -498,6 +498,7 @@
 }
 
 proc ::htmlparse::DoDecMap {dec endOf} {
+    scan $dec %d dec
     if {$dec <= 0xFFFD} {
 	return [format %c $dec]
     } else {
Index: htmlparse.test
===================================================================
RCS file: /cvsroot/tcllib/tcllib/modules/htmlparse/htmlparse.test,v
retrieving revision 1.12
diff -u -r1.12 htmlparse.test
--- htmlparse.test	1 Oct 2004 01:21:56 -0000	1.12
+++ htmlparse.test	4 Oct 2004 14:22:15 -0000
@@ -241,6 +241,10 @@
     ::htmlparse::mapEscapes {too big: &#xffff; and unharmed}
 } {too big: &#xffff; and unharmed}
 
+test htmlparse-4.8 {numeric character references, leading zeros} {
+    ::htmlparse::mapEscapes {Ampersand: &#038;.}
+} {Ampersand: &.}
+
 proc tlist {t n} {
     set tt [list]
     foreach c [$t children $n] {
@@ -299,8 +303,6 @@
     [list p     /  {} {}] \
     [list html  /  {} {}] ]
 
-
-
 # Tcllib SF Bug 861287 - Processing of comments.
 test htmlparse-7.1 {html comments} {
     set tags [list]