Last modified: 2012-12-14 10:22:38 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T41840, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 39840 - Search & Replace does not work in Opera
Search & Replace does not work in Opera
Status: RESOLVED WORKSFORME
Product: MediaWiki extensions
Classification: Unclassified
WikiEditor (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-31 14:42 UTC by Christian Thiele
Modified: 2012-12-14 10:22 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Christian Thiele 2012-08-31 14:42:38 UTC
(I think this is also reported in bugs 22358 and 22816, but these aren't maintained anymore and are really crowded)

The "find" routine of "Search&Replace" does not work as expected in Opera and therefore "replace" doesn't work either.

The problem are line breaks: When getting the text from the textarea, all \r are removed, so every line break is only one character (\n). When setting the text selection (selectionStart/selectionEnd) Opera counts the line breaks as two characters (\r\n).

Example:
A\r\n
B

If you want to select "B", the text of the textarea is loaded, but then the \r is removed: "A\nB", so selectionStart=2 and selectionEnd=3. If applied to the above text, the following result is shown (selection in []):

A\r[\n]
B

The \n is selected instead of the B.

The problem is inside "jquery,mediawiki". The function "val" on line 2143 is used to get the content of the textarea. I don't know why, but on line 2159 not "ret" is returned, but "ret.replace(rreturn, "")", which removes the \r.

I really don't know why this is done. Firefox+Chrome don't contain any \r in textareas, so removing the replacement should work in Opera - but of course I don't know which functions also rely on this "val" function.
Comment 1 Christian Thiele 2012-12-13 17:45:34 UTC
Works for me now.
Comment 2 Andre Klapper 2012-12-14 10:22:38 UTC
Thanks for updating the ticket, and sorry that nobody took a look at it before. :-/

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links