1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed Replacing link with another link problem

Discussion in 'Resolved Bug Reports' started by AndyB, Feb 18, 2014.

  1. AndyB

    AndyB Well-Known Member

    Steps to reproduce:

    1) Create post with a link
    2) Go to some other tab
    3) Highlight URL
    4) Copy URL to clipboard
    5) Go back to tab with post
    6) Edit post
    7) Highlight link
    8) Paste link from clipboard
    9) Save

    You will see the new link shows the correct URL but when you click the link it takes you to the old URL.

    Using OS X with Firefox.
  2. Chris D

    Chris D XenForo Developer Staff Member

    This is pretty much the expected behaviour, (I think).

    I suspect what is happening is the URL is parsed like this: [URL='http://www.google.co.uk']http://www.google.co.uk[/URL]. So when you then edit that in the text editor, the end result is this: [URL='http://www.google.co.uk']http://www.bing.co.uk[/URL]

    Could you verify what the BB Code is after the post has been edited? I imagine it would resemble the above.
  3. Mike

    Mike XenForo Developer Staff Member

    What Chris has explained is the behavior. Whether or not it's totally expected is definitely debatable - it depends on whether you consider the selection to be inside or out of the wholly selected tags.

    I'm experimenting with a change here though that attempts to select as much as possible when replacing content (via a paste).
    AndyB, Rob and Chris D like this.
  4. AndyB

    AndyB Well-Known Member

    Thank you for fixing this, Mike.

Share This Page