Menu

#232 &#x200B is copied

v1.1
open
nobody
None
5
2013-03-20
2013-03-18
Yimin Li
No

There is a link on the right or LXR logo, to navigate through different folders. For example, "current/​README". But when I tried to copy the text by selecting "current/​README" and then press Ctrl-C, and pasted it in vim, "current/<200b>​README" was actually copied.

Seems like this &#x200B is redundant for my Firefox and really annoying in vim. Does some browser need &#x200B to separate links?

Thanks!

Discussion

  • Andre-Littoz

    Andre-Littoz - 2013-03-18

    Hi,
    This is design decision: &#x200B is Unicode ZERO-WIDTH-SPACE.
    The navigation links (the "banner") you mention are a sequence of <a> partial paths references separated by a slash and formatting hint as:

    &lt;a href=...>current&lt;a>/&amp;#x200B;&lt;a href=...>README&lt;/a>
    

    If the ZERO-WIDTH-SPACE were not used, HTML formatting would add a space between the components giving an ugly visual appearance and a larger width to the links. This could also suggest that they are independent access paths instead of a single path.

    This ZERO-WIDTH-SPACE is not redundant at all in Firefox (nor in any other browser) to obtain a continuous path as usually coded in shell.

    Now what do you want to do with this link copy-and-paste? Do you intend to use the path in a vim command? In that case, the better place to copy the path is in the browser address bar (where you read http://hostname/lxr/source/...file-path...?optional-arguments). The address bar does not contain any formatting artefacts.

    Unless you give good arguments, this report will be closed with "wont-fix" status.

    ajl

     
  • Yimin Li

    Yimin Li - 2013-03-18

    I think the links are separated by "/". The following HTML code works fine here (in Firefox and Chrome):

    <tr>
        <td class="banner"><span class="banner"><a class='banner' href="/gtest/source/">current</a>/<a class='banner' href="/gtest/source/include/">include</a>/</span></td>
    </tr>
    
     

    Last edit: Yimin Li 2013-03-18
  • Andre-Littoz

    Andre-Littoz - 2013-03-19

    There is a difference between your sequence and LXR's: yours is on single line while LXR generates one path-element per line. The end-of-line may be transformed into a space.

    I'll check as soon as I'm back from my business trip. If the ZERO-WIDTH-SPACE is no longer relevant (it was at some time in the past), I'll remove it.

     
  • Andre-Littoz

    Andre-Littoz - 2013-03-20

    My last comment is wrong.

    When you have a very long path (e.g. you're browsing Linux kernel code deep into the directory hierarchy), that path is too long to fit on a single line in the header area and the browser breaks the strings in a number of lines.

    A file path is not ordinary text made of words separated by spaces. For ordinary text, the browser breaks the line at spaces so that every line makes sense (words are not broken).

    A file path contains usually no spaces so that the browser has no "natural" way to break it. It turns out that it breaks the string at a number of characters that fit in the line. The break happens anywhere in the middle of file path components. ZERO-WIDTH-SPACE was inserted after the path separator / to provide hints for the browser in case it needs to break the line.

    With ZERO-WIDTH-SPACE, directory names are never broken (unless very very long) and the banner remains meaningful without the effort of wondering if the name was broken or not.

    Consequently, there is little chance I remove ZERO-WIDTH-SPACE (unless you give me a real good reason). If you want to copy and paste the path, do it from the browser address bar, which contain no stray character.

     

Log in to post a comment.