While creating hyperlinks, Indesign inserts some zero-width space characters in to the text. Due to this at some place reflow may occur. It seems weird to me as well, but this is how Indeisgn will work.
This problem occurs while inserting XML tags and index markers as well.
Looking to hear from some adobe guys .
Yeah, much to my dismay I saw this happen on otherwise complete documents: adding a simple XML or hyperlink markup -- which should have been fully transparent to the actual text -- suddenly made the text re-compose.
A possible solution for Lionel is to create rectangles on top of the text, and assign the hyperlinks to these instead. These rectangles could be created on a layer of their own, so they can easily be removed if the text gets edited.
A small drawback is that you can measure bottom, left, and right of text -- but not the top! However, you can sort of fake it: make the rectangle one leading amount high and move it down by about a 1/3th of its height (eyeballing result).
I was looking at the intools's solution to freeze the document (http://in-tools.com/article/scripts-blog/freeze-composition/) but Jongware's solution seems even smarter. I'll try it and let you know.
Jongware's solution works perfectly. I just have to take care of hyphenated text when I create rectangles.
Best regards, thanks a lot,