Last modified: 2011-04-21 08:21:28 UTC
There's a bug in insertTags() function causing Opera 9.5x select wrong text when inserted text contains newline characters. Example: mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://upload.wikimedia.org/wikipedia/en/f/fd/Button_blockquote.png", "speedTip": "FooBar", // <nowiki> "tagOpen": "foo foo(", "tagClose": ")bar\nbar\nbar\nbar", "sampleText": "baz baz"}; This bug causes problem on Wiktionary, as buttons inserting multi-line text are in common use there (nearly on every edit creating a new page). Suggested solution: Remove if (window.opera) tagClose = tagClose.replace(/\n/g,''); (terrible browser sniffing BTW) - this helps on Opera 9.5, don't know how it's with previous persions, but I remember the problem with insertTags() at least since the very beginning of Opera 9.x versions. Alternatively, your can change browser sniffing to: if (is_opera && is_opera_seven) or something like this. Or, the best way, remove the browser sniffing completely: http://dev.opera.com/articles/view/a-browser-sniffing-warning-the-trouble/
For your knowledge: we on Polish Wiktionary have to add a lot of JavaScript to fix this bug - because we are not able to remove two buggy lines from edit.js otherwise. http://pl.wiktionary.org/wiki/MediaWiki:Common.js/edit.js
Please note that we are in year 2010 and noone uses Opera 7, so this fix 'if (window.opera)' no longer helps anybody, and makes trouble for all Opera users instead.
Fixed in r86603