Page MenuHomePhabricator

Anchored regular expressions behave unexpectedly with magic links
Closed, ResolvedPublic8 Estimated Story Points

Description

  1. Go to https://de.wikipedia.org/wiki/Internationale_Mathematik-Olympiade?veaction=edit
  2. Search for $ (space + dollar) as regular expression.

Expected: This should find (superfluous) spaces at the end of a paragraph, in this case none.
Actual: This finds the spaces in front of ISBNs (but not spaces in front of normal links).

I know VE well enough to understand what's happening: Normal links are annotations, but magic links are nodes. Still, this behavior is unexpected and usually unwanted.

Perhaps it is possible to use U+FFFC (object replacement character) instead of \n for maintaining the indices for inline nodes, though this will require a careful handling when replacing contents.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Deskana set the point value for this task to 8.
Deskana moved this task from To Triage to Freezer on the VisualEditor board.

Change 427022 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[VisualEditor/VisualEditor@master] Improve behavior of newlines and non-text content elements in find-and-replace

https://gerrit.wikimedia.org/r/427022

Change 427022 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] Improve behavior of newlines and non-text content elements in find-and-replace

https://gerrit.wikimedia.org/r/427022

Change 432608 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (b8c05e38c)

https://gerrit.wikimedia.org/r/432608

Change 432608 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (b8c05e38c)

https://gerrit.wikimedia.org/r/432608

Jdforrester-WMF renamed this task from Anchored regular expressions behave unexpected with magic links to Anchored regular expressions behave unexpectedly with magic links.May 15 2018, 11:33 AM