This was something I am more curious about, than a solid programming issue to be solved. Sorry about that in advance.
I noticed that when inserting images into a publishing page's Page Content field, SharePoint is doing something to track changes to that image's file name. I am just curious if anyone know what or how it does it.
If you change the file name in the library, or move it to a different folder in that library, it automatically updates the html link reference on the page it was inserted.
Pretty cool but it gets weirder.
If you manually paste in your own image link HTML code directly into the Edit HTML dialog for an image in your Images library (any library really, this works for documents too), and then go change the name or location, it updates your HTML.
If you change your img tag to point to a file that does not yet even exist, and THEN upload and image with that name, not only will it appear on your page (as expected) but if you update the image name in library, it updates your HTML correctly then too.
By this point the voodoo was too strong for me to fathom how this was possible, since it happens when the file is updated (seemingly), not when the HTML is updated, since you can put the link in first, and then update image name later.
Does anyone know, or have any decent guesses who this is done?