First the linked graphic regex is applied. Then the non-linked. Both produces matches for the hyperlinked graphic case. So the same graphic reference gets used twice.
Fix involves checking whether this graphic already seen on - in a nested way. (Bounds within the first match.) Nested necessary to cope with case where two copies of the same graphic on the same line.
First the linked graphic regex is applied. Then the non-linked. Both produces matches for the hyperlinked graphic case. So the same graphic reference gets used twice.
Fix involves checking whether this graphic already seen on - in a nested way. (Bounds within the first match.) Nested necessary to cope with case where two copies of the same graphic on the same line.
Coded fix up.