jquery-markedit icon indicating copy to clipboard operation
jquery-markedit copied to clipboard

Inserting an links fails if there is an existing link and this one is located after

Open aleray opened this issue 14 years ago • 2 comments

Steps to reproduce the bug:

  1. insert a link anywhere
  2. 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!

aleray avatar Sep 17 '10 23:09 aleray

It's likely a problem with the Regex incorrectly identifying the trailing link as being part of the current link.

tstone avatar Jan 04 '11 05:01 tstone

Has anybody made a patch for this? It's kinda annoying bug.

jpartogi avatar Mar 16 '11 11:03 jpartogi