Last modified: 2014-11-08 15:32:49 UTC
Steps to reproduce: 1. Open any page for editing, open the "Advanced" toolbar from WikiEditor. 2. Click the icon for inserting a list. Expected result: The sample text "Bulleted list item" is selected. Actual result: It is not. If you don't have WikiEditor installed, you can execute $( '#wpTextbox1' ).textSelection( 'encapsulateSelection', { pre: '* ', post: '\n', peri: 'item', selectPeri: true, splitlines: true } ); instead of step 2 (which also shows that this indeed is an issue with jquery.textSelection, and not with WikiEditor).
selectPeri is documented (in code) not to work with splitlines: selectPeri: true, // Select the peri text if it was inserted (but not if there was a selection and replace==false, or if splitlines==true) splitlines: false, // If multiple lines are selected, encapsulate each line individually The code and comments are clear that this is intentional and by design, and there even is a test for this behavior. I'm not sure if we should change it.
Hm. Blame tells me that I reported the bug for which this was changed: Bug 29105. Of course, when the sample text can't be selected (because it is splitted into multiple parts) it shouldn't be selected. But if it can, it should, and in most cases there shouldn't be newlines in the sample text, so it won't get split up. When you use WikiEditor to insert a list, you want to override the sample text. Why should you have to select it yourself to do so?
Hmm. Okay, that's actually reasonable.