Not to be naggy, but this is currently the second highest voted bug on MSO that has zero answers.
And there are only 3 questions that would be higher than it on the much larger MSE.
Any updates would be nice.
When selecting multiple lines of text and applying bullet formatting, either through the control panel or with Ctrl + U, the text editor converts everything to a single line. This is divergent from the way most text editors apply bullets.
If there's a carriage return in the highlighted text portion, can the line return be preserved?
For Example:
If I've highlighted the following three lines:
Apple
Banana
Carrot
When I apply bullets, I get the following result:
* Apple Banana Carrot
But I would expect this:
* Apple
* Banana
* Carrot
Here's some relevant code:
Demo in Fiddle
The issue occurs in the Markdown.Editor.js file in the function commandProto.doList
Specifically, when this.wrap
is called on the code, it strips out the carriage returns.
A naive implementation could fix this by replacing these two lines:
this.wrap(chunk, SETTINGS.lineLength - spaces.length);
chunk.selection = chunk.selection.replace(/\n/g, "\n" + spaces);
With these two lines:
//this.wrap(chunk, SETTINGS.lineLength - spaces.length);
chunk.selection = chunk.selection.replace(/\n/g, "\n" + getItemPrefix());
This fixes a simple bulleting case, however other issues arise so a better solution is still needed.
I just added this as an issue on pagedown, but believe it will get better attention here.
It's relevant here since it affects the User Experience throughout the entire Stack Exchange network.