[PATCH RFC V2] hgweb: code selection without line numbers in file source view

Laurens Holst laurens.nospam at grauw.nl
Mon Jul 1 05:02:57 CDT 2013


Op 01-07-13 01:06, Matt Mackall schreef:
> On Sun, 2013-06-30 at 20:44 +0200, Laurens Holst wrote:
>> Op 29-6-2013 23:09, Alexander Plavin schreef:
>>>>> +  <li class="parity{parity} source" id="{lineid}"><div>{ifeq(strip(line,
>>>>> '\r\n'), '', ' ', '')}{strip(line|escape, "\r\n")}</div></li>'
>>>> I would use \u00A0 instead of  .
>>> Why is this better?
>> I don’t like the entities. <Insert some irrelevant reason about XML not
>> being able to understand HTML’s extended set of entities without a DTD
>> even though this is neither XML nor XHTML>. And it’s more bytes.
>>
>> In a Unicode world, no reason to not just output the actual character
>> you want.
> Quiz: what happens when hgweb's output encoding is set to Windows
> CP1252?

Presumably it’d be fine, cause the non-breaking space also exists in 
CP1252 at the same code point...

> Quiz: what percentage of developers do you expect to have the _UTF-8_
> byte sequence (never mind the raw Unicode) for nbsp memorized?

I was mostly thinking when looking at the source view it would look 
cleaner, instead of having entities all over.

Also, I don’t know what the UTF-8 byte sequence has to do with anything 
unless someone’d be looking at the HTML source with a hex editor.

> Quiz: how often do you use \x0d rather than \n when coding? how often is
> it the right thing to do?

Well \n still outputs the actual character. A better question would be, 
how often is outputting &x0A; the right thing to do? (As opposed to the 
newline character itself.)

But it’s just a remark, Alex asked for feedback, I just said what I 
would do, it’s fine to disagree.

~Laurens



More information about the Mercurial-devel mailing list