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

Alexander Plavin me at aplavin.ru
Wed Jul 3 11:07:53 CDT 2013


2013/7/3 Matt Mackall <mpm at selenic.com>:
> On Wed, 2013-07-03 at 14:05 +0200, Martin Geisler wrote:
>> Alexander Plavin <me at aplavin.ru> writes:
>>
>> (You're top-posting. It is more convenient if you put your comments
>> after the thing they apply to.)
>>
>> > In this case the whole lines are links, which makes it impossible to
>> > select a random region (at least I couldn't do it) and isn't a good
>> > thing anyway as for me. Also, both embedded and leading tabs are lost
>> > on copy (tried several times, as you state the opposite, but same
>> > result).
>>
>> Okay, you have a good point about the links making the text
>> un-selectable. What do you think about the version below where we use
>> JavaScript to install a click handler? I can mark text anywhere and when
>> doing so the URL is updated to include the relevant ID, so that one can
>> copy-paste the URL.
>
> This approach looks very promising indeed.
>
> Can we avoid pulling in jquery?

Of course, it's used in this example just for simplicity.

> Can we make the line numbers anchor links?

According to the CSS documentation, it's not possible with 'content' property.

>
> --
> Mathematics is the supreme nostalgia of our time.
>
>


More information about the Mercurial-devel mailing list