Page MenuHomePhabricator

Add link sometimes inserts <nowiki/> tag
Closed, ResolvedPublicBUG REPORT

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

@KStoller-WMF this probably something that we should prioritize looking at.

kostajh triaged this task as Medium priority.Mar 6 2023, 10:19 AM

These seem to be regex match index off-by-one-errors. E.g.

  • diff, wikitext, recommendation - 2nd occurrence of stres linked, should have been the 3rd. match_index is 1; the first instance is within a wikilink, so that's correct.
  • diff, wikitext, recommendation - 1st instance of přístav linked, should have been the 2nd. match_index is 1; that is correct.
  • diff, wikitext, recommendation - 5th instance of rukopis linked, should have been the 6th. match_index is 4; one of the occurrences is within a heading so that's correct.

I have scanned all 'add link' edits in the last 30 days on cswiki (587 edits) and haven't found a single occurrence. Maybe the problem is gone.

Thanks for the update @matej_suchanek!
@Etonkovidova is reviewing, and hopefully we can mark this as resolved if this doesn't appear to be an issue any longer.

Etonkovidova claimed this task.

Looking at the reported cases, I noticed that all cases when <nowiki/> was inserted happens when a link was suggested (and inserted) on words with modifiable ending, e.g.
https://cs.wikipedia.org/w/index.php?diff=22248544
[[rukopis]]<nowiki/>ů

https://cs.wikipedia.org/w/index.php?diff=21867778
[[ocas]]<nowiki/>e

It seems that only a word's stem part was matched when a link was inserted. I checked cswiki beta for cases when the word to be linked is different from the linked title, e.g. the following suggestion was inserted correctly (without <nowiki/>

Screen Shot 2023-10-19 at 4.55.31 PM.png (748×972 px, 170 KB)

https://cs.wikipedia.beta.wmflabs.org/w/index.php?title=Pohrani%C4%8Dn%C3%AD_str%C3%A1%C5%BE_Znojmo&diff=4479&oldid=726
Screen Shot 2023-10-19 at 4.59.32 PM.png (332×932 px, 93 KB)

Also, quickly checked the recently added links on cswiki wmf.1 and, as @matej_suchanek mentioned in the comment above, no recent insertions of <nowiki/> were found. Checked the global search (in case I may spot something) - all looked ok.

Closing as Resolved for now.