Re: [PATCH] Use   instead of for XHTML compliance
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- Apr 15, 2009, 15:55 UTC
- Message-ID
- <200904151755.07425.jnareb@gmail.com>
- In-Reply-To
- <20090415154012.GX13966@inocybe.teonanacatl.org>
On Wed, 15 April 2009, Todd Zullinger wrote:
Show 8 quoted lines
> From: Ricky Zhou <ricky@fedoraproject.org> > --- > > This was noticed by the Fedora Infrastructure folks. The pages > rendered fine in Firefox, but caused an XML error when run through tor > and privoxy together. Part of this problem description may belong in > the commit message -- I was hesitant to add it, as I didn't read all > of the IRC log where the problem was noticed and debugged.
Wouldn't it be a better solution to add DTD with HTML entities if/when gitweb serves XHTML 1.0 together application/xhtml+xml mimetype, instead of unconditionally using what is I think worse solution? Especially that error is I think quite rare situation and/or bug in browser...
I also don't think that the change -nbsp => -subspaces is necessary; it causes large code churn for nothing, and name is IMVHO worse. It is about nonbreakable and non-compactable space.
Show 19 quoted lines
>
> gitweb/gitweb.perl | 40 ++++++++++++++++++++--------------------
> 1 files changed, 20 insertions(+), 20 deletions(-)
>
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index 33ef190..55b56f7 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -1042,8 +1042,8 @@ sub esc_html ($;%) {
>
> $str = to_utf8($str);
> $str = $cgi->escapeHTML($str);
> - if ($opts{'-nbsp'}) {
> - $str =~ s/ / /g;
> + if ($opts{'-subspaces'}) {
> + $str =~ s/ / /g;
> }
> $str =~ s|([[:cntrl:]])|(($1 ne "\t") ? quot_cec($1) : $1)|eg;
> return $str;-- Jakub Narebski Poland