none
Whitespace is removed from between adjacent <a> tags RRS feed

  • Question

  • If you have adjacent hyperlinks with only whitespace between them, the whitespace gets removed when you hit enter.

    Repro steps:

    1. Create a new post or reply.
    2. Enter the following text in the body:
      hello world
      (Or really any two words with a space in between)
    3. Select the first word and click the Insert Hyperlink button (or use the Ctrl+K keyboard shortcut)
    4. Give it any url ... doesn't matter what.
    5. Select the second word and click the Insert Hyperlink button (or use the Ctrl+K keyboard shortcut)
    6. Give it any url ... doesn't matter what.
    7. Position the cursor at the end of the line and hit Enter.

    The whitespace between the hyperlinks is erroneously removed.  I propose that the correct HTML output should have an &nbsp; between the two hyperlinks to preserve the space in the output.

    Instead, you'll find that it will actually look like this, with no space in between the words:

    helloworld

    Additionally, the markup will include an extra <a> tag for the second link in its own paragraph <p>:

    <p><a href="http://www.microsoft.com/">hello</a><a href="http://www.bing.com">world</a></p><p><a href="http://www.bing.com"></a></p>

    NOTE: This doesn't repro when there is no other text in the body, so follow the repro steps carefully.

    NOTE: I'm observing this in Chrome on Win7

    Thursday, June 27, 2013 1:36 PM

Answers

  • I was able to duplicate this in the Sandbox forum, but I had to follow your steps exactly. In fact, if I attempted to repeat the issue later in the reply, it did not behave the same way (the space between the words remained). It only happened if these were the first words in the reply. I tested using IE9 on Win7.


    Richard Mueller - MVP Directory Services

    Friday, June 28, 2013 5:02 PM
    Moderator