From: Junio C Hamano Date: Fri, 03 Nov 2006 21:44:29 GMT Subject: Re: [PATCH 2/n] gitweb: Use '&iquot;' instead of '?' in esc_path Message-ID: <7virhw5hoi.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <200611031719.13073.jnareb@gmail.com> Jakub Narebski writes: > # quote unsafe characters and escape filename to HTML > sub esc_path { > my $str = shift; > $str = esc_html($str); > $str =~ s!([[:cntrl:]])!sprintf('&#%04d;', 9216+ord($1))!eg; > return $str; > } > > with perhaps the following CSS > > span.cntrl { > border: dashed #aaaaaa; > border-width: 1px; > padding: 0px 2px 0px 2px; > margin: 0px 2px 0px 2px; > } > > What do you think of it? Probably "# quote unsafe characters" is not what it does yet (it just quotes controls currently and nothing else), but we have to start somewhere and I think this is a good start.