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]
