jquery-markedit
jquery-markedit copied to clipboard
Inserting an links fails if there is an existing link and this one is located after
Steps to reproduce the bug:
- insert a link anywhere
- insert a link before link created in step 1
What happens?:
- insertion fails: no link is added
- selected text start from selection start index of step 2 and ends at selection stop index of step 1.
Comment:
there seems to be something wrong with the code starting at line 551:
551 // Get the selected URL
552 var afterMatch = MarkEdit.RegexLinkEnd.exec(state.afterSelect);
553 var urlIndex = -1;
554 var selUrl = '';
555 if (afterMatch) {
556 urlIndex = Number(afterMatch[2]) - 1;
557 selUrl = state.links[urlIndex];
558 }
Hope it helps!
It's likely a problem with the Regex incorrectly identifying the trailing link as being part of the current link.
Has anybody made a patch for this? It's kinda annoying bug.