11

While asking a question on Stack Overflow, I had the need to reference the same URL twice within the content. I thought I'd try to conserve the amount of text by re-using this URL twice within the same question. As in, defining only one [1] URL definition at the bottom of the question, and two hyperlink references to that same URL in two different hyperlinks.

However, upon saving this new question, and opening it back up in edit mode, it appears that it automagically produced two separate URL definitions [1] and [2] for the same duplicate URL.

What is the purpose/reason of this behavior?

PS: I'm doing the same in this question on MSO to see if the same result happens.

enter image description here

UPDATE (before even first submission of this post)

While writing this question, immediately after I posted the screenshot above, it changed to duplicate references:

enter image description here

I can't imagine any reason why it would explicitly convert 1 URL into 2 just because I'm using it twice.

7
  • 1
    Oh, I apologize - I read your post sloppily and didn't realize you had specified only one link. The system's behaviour still feels right to me but it's a different issue than I was commenting on. Going to delete my comments
    – Pekka
    Commented May 30, 2015 at 18:10
  • 6
    I come across this a lot when posting images. If they are large I make them easily clickable to open up in another browser tab with a link containing the image and both using the same url [![][1]][1] AFAIK every time you use the UI to add another image or link it re-numbers them. Seems unnecessary complexity to me - and the facility is buggy and re-numbers code too Commented May 30, 2015 at 18:28
  • 2
    The way I understand it, somebody explicitly wrote some code which splits these two hyperlinks into their own URL references. "Natural" coding wouldn't consist of this type of practice. There must be some reason why the developers chose to split duplicate URL's for duplicate hyperlinks.I only see a wasted bit of processing power on Stack Exchange. Commented May 30, 2015 at 19:28
  • "Natural" code would be allowing whatever the developer desires. Commented May 30, 2015 at 19:49
  • 1
    smells like an encoding-decoding roundtrip bug Commented May 31, 2015 at 1:37
  • I'm guessing the content is loaded into some sort of structure which parses it into different pieces, and then puts it back together again. Commented May 31, 2015 at 1:48
  • 2
    The problem is in that link dialog insertion. It not only keeps duplicate links merged, but also breaks [] enclosed indices. If you insert them manually (without that Ctrl+L dialog), you should get what you write (at least it was so when I was reporting a duplicate of the bug report @Martin linked, which I've deleted due to this cross site post).
    – TLama
    Commented May 31, 2015 at 17:46

0

You must log in to answer this question.

Browse other questions tagged .