Page MenuHomePhabricator

CodeMirror + WikiEditor doesn't 'Replace all' correctly
Closed, ResolvedPublic1 Estimated Story Points

Description

Reported here: https://meta.wikimedia.org/wiki/Talk:Community_Tech/Wikitext_editor_syntax_highlighting#Fail:_Search_and_Replace

I was not able to reproduce on the same OS and browser, but a user is reporting that:

I'm having a somewhat similar issue in that the search and replace doesn't actually replace anything if I choose "Replace all" with syntax highlighting on. Individual replace works fine with it on, and "Replace all" works fine with it off, though. I'm on Firefox (58.0.2) and OS X.

Event Timeline

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

Appears in Chrome 63 and Firefox 57 on Windows 7 x64. On all projects (tested also different Acc.)

  • Only on Replace all

The relevant code block, textSelection returns undefinied:

$textarea = $("#wpTextbox1").textSelection( 'setSelection', { start: 0, end: 10 } )

But also separate search works only for the first hit (replace step by step works ironically).

Change 414646 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/CodeMirror@master] TextSelection: Make chainable methods chainable

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

Esanders set the point value for this task to 1.

This affects WikiEditor, but not 2017 WTE.

Esanders renamed this task from CodeMirror & 2017 Wikitext editor on OSX/Firefox sometimes doesn't 'Replace all' correctly to CodeMirror + WikiEditor doesn't 'Replace all' correctly.Feb 26 2018, 11:52 AM
Esanders moved this task from Incoming to Code review on the VisualEditor (Current work) board.

Change 414646 merged by jenkins-bot:
[mediawiki/extensions/CodeMirror@master] TextSelection: Make chainable methods chainable

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

Deskana triaged this task as Medium priority.