bugfix for handling references with tooltips

references in the text that span over 2 or more lines caused a crash
previously that was handled by separating data collection from the
creation of the rectangles for the tooltips