Fixed Replacing link with another link problem

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.
 
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.
 
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).
 
Top Bottom