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

Re: Whitespace and '&nbsp'

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
May 26, 2011, 22:21 UTC
Message-ID
<vpqpqn5m7cc.fsf@bauges.imag.fr>
In-Reply-To
<7vzkm9unu0.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> I do not think people deliberately put these things to their editor,

I never put them in C code, but I do often have some in text and LaTeX files: the French typography rules uses more spaces than the english ones, in places where one shouldn't break lines (before :, !, ? and inside « French quotes »). Real typographers would distinguish short non-breaking spaces and normal ones, but I usually don't ;-).

My editor shows them as a space underlined in slight color. One can reproduce this in a terminal with things like

echo -e '\033[3;4m '           # no color
or
echo -e '\033[1;4m\033[1;31m ' # red underline space

That's lighter than full red background, hence acceptable as a warning that people who purposely use &nbsp can ignore.

> But in the longer term, I think we should find what MUA causes this
> breakage and yell at them.
A common typo for French people is to type
foo | bar
     ^
   &nbsp;

since the | needs Alt-gr on azerty keyboard, and Alt-gr + Space gives a &nbsp;. Particularly painfull to diagnose since the shell answers e.g.

zsh: command not found:  bar
{ and } also requires Alt-gr, so I can imagine someone typing
if (foo) {
        ^
      &nbsp;
by mistake.
> It might be some mail relays, but I am not sure where these come from.
> I often see alternating real whitespace and nbsp in "> " indented
> quotes.

I often see them too, I guess the mailer does this to prevent other (broken) mailers from rewrapping, but I don't like it either.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Daniel Nyström
Message 15 of 15 in “Whitespace and '&nbsp'”
  1. Linus TorvaldsMay 26, 2011
  2. Junio C HamanoMay 26, 2011
  3. Linus TorvaldsMay 26, 2011
  4. Andreas SchwabMay 27, 2011
  5. Linus TorvaldsMay 27, 2011
  6. Junio C HamanoMay 27, 2011
  7. Junio C HamanoMay 27, 2011
  8. Linus TorvaldsMay 27, 2011
  9. Junio C HamanoMay 27, 2011
  10. 1/3 ws.c: add a helper to format comma separated messagesJunio C Hamano, May 27, 2011
  11. 2/3 War on nbsp: a bit of retreatJunio C Hamano, May 27, 2011
  12. 3/3 War on nbsp: Add "nbsp" whitespace breakage classJunio C Hamano, May 27, 2011
  13. 4/3 War on nbsp: teach "git apply" to check and fix nbspJunio C Hamano, May 28, 2011
  14. Daniel NyströmMay 30, 2011
  15. Matthieu MoyMay 26, 2011

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.