git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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/ /&nbsp;/g;
> +	if ($opts{'-subspaces'}) {
> +		$str =~ s/ /&#160;/g;
>  	}
>  	$str =~ s|([[:cntrl:]])|(($1 ne "\t") ? quot_cec($1) : $1)|eg;
>  	return $str;
-- 
Jakub Narebski
Poland
Previous: Ricky ZhouNext: Ricky Zhou
Message 4 of 5 in “Use &#160; instead of &nbsp; for XHTML compliance”
  1. Use &#160; instead of &nbsp; for XHTML complianceTodd Zullinger, Apr 15, 2009
  2. Mike HommeyApr 15, 2009
  3. Ricky ZhouApr 15, 2009
  4. Jakub NarebskiApr 15, 2009
  5. Ricky ZhouApr 15, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.