Page MenuHomePhabricator

Anchored regular expressions behave unexpectedly with magic links
Closed, ResolvedPublic8 Estimate 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.

Details

Related Gerrit Patches:

Event Timeline

Schnark created this task.Jan 4 2018, 8:33 AM
Restricted Application added a project: VisualEditor. · View Herald TranscriptJan 4 2018, 8:33 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Deskana triaged this task as Low priority.Jan 9 2018, 7:48 PM
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

matmarex added a project: Patch-For-Review.

Patch is not reviewed yet :(

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 removed a project: Patch-For-Review.
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

Oops, yes, sorry; done now though!

Deskana closed this task as Resolved.May 14 2018, 1:04 PM
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