65

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.

6
  • 10
    "It's relevant here since it affects the User Experience throughout the entire Stack Exchange network." you're on the wrong site for the entire network, though, now that there's a meta for stackexchange as a whole...
    – Wooble
    Jun 9, 2014 at 12:51
  • 1
    @Wooble, Totally agree! I initially thought I had posted to MSE. Once I realized my mistake it had already garnered a little attention and didn't want to give it up. An acceptable trajectory for most meta questions is to post on your preferred meta and it will get migrated if it involves the entire site, so I was hopeful that it would get migrated to MSE once it got picked up.
    – KyleMit StaffMod
    Jun 9, 2014 at 12:55
  • It'd be nice if Stack Overflow specifically could use a plugin that actually helps with writing code such as codemirror.
    – zzzzBov
    Jun 9, 2014 at 13:22
  • 4
    @zzzzBov, but most people shouldn't be writing code in the SO editor anyway. That's not really it's job. They should be copying and pasting code from somewhere that can actually successfully run/compile it.
    – KyleMit StaffMod
    Jun 9, 2014 at 13:27
  • 4
    @KyleMit Well, simply add a compiler backend for every language SO supports, and problem solved. It can also provide ponies. Jun 9, 2014 at 13:42
  • 7
    @KyleMit, that may be true for questions, but that's no reason to dumb down the editor. I write a lot of code in answers, and don't need to paste it in from somewhere. Having some nicer tools with tabbing capabilities and multiple cursors would help me fix indentation issues and formatting erors.
    – zzzzBov
    Jun 9, 2014 at 14:57

0

You must log in to answer this question.

Browse other questions tagged .