When you add some mention more than once, the position of all mentions except the first is incorrect. The reason is that every time indexOf() return the first occurrence of the mention. We can calculate the position, using position into formated text and length of all additional data used in previous mentions (5 special characters - @[]() and length of the uid).
When you add some mention more than once, the position of all mentions except the first is incorrect. The reason is that every time indexOf() return the first occurrence of the mention. We can calculate the position, using position into formated text and length of all additional data used in previous mentions (5 special characters -
@[]()
and length of the uid).