@@ -81,7 +81,7 @@ class HTMLSanitizer(HTMLTokenizer):
8181 'xmlns:xlink' , 'y' , 'y1' , 'y2' , 'zoomAndPan' ]
8282
8383 attr_val_is_uri = ['href' , 'src' , 'cite' , 'action' , 'longdesc' ,
84- 'xlink:href' ]
84+ 'xlink:href' , 'xml:base' ]
8585
8686 acceptable_css_properties = ['azimuth' , 'background-color' ,
8787 'border-bottom-color' , 'border-collapse' , 'border-color' ,
@@ -138,7 +138,7 @@ def __iter__(self):
138138 attrs = dict ([(name ,val ) for name ,val in token ["data" ][::- 1 ] if name in self .allowed_attributes ])
139139 for attr in self .attr_val_is_uri :
140140 if not attrs .has_key (attr ): continue
141- val_unescaped = re .sub ("[\000 -\040 \177 -\240 \s]+" , '' , unescape (attrs [attr ])).lower ()
141+ val_unescaped = re .sub ("[` \000 -\040 \177 -\240 \s]+" , '' , unescape (attrs [attr ])).lower ()
142142 if re .match ("^[a-z0-9][-+.a-z0-9]*:" ,val_unescaped ) and (val_unescaped .split (':' )[0 ] not in self .allowed_protocols ):
143143 del attrs [attr ]
144144 if attrs .has_key ('style' ):
@@ -158,6 +158,8 @@ def __iter__(self):
158158 token ["type" ] = "Characters"
159159 del token ["name" ]
160160 yield token
161+ elif token ["type" ] == "Comment" :
162+ pass
161163 else :
162164 yield token
163165
0 commit comments