Quantcast
Channel: The code block button doesn't work properly in lists - Meta Stack Overflow
Viewing all articles
Browse latest Browse all 2

The code block button doesn't work properly in lists

$
0
0

When you write code out, then you select it and hit the code button (or use the K+Ctrl combo). It doesn't work properly in lists, and "breaks" the typical formatting....

  • I'll start of a random list, then I'll try to use a code block here:

    let theDevelopers = "have a break";

As you can see, it only indents it to the list (probably by-design), and doesn't treat it code block...

There is two ways to solve this:

 - I'll start of a random list, then I'll try to use a code block here:<!-- Making a comment, to break the flow -->    let theDevelopers = "have a break";

Or

- I'll start of a random list, then I'll try to use a code block here:        let theDevelopers = "have a break";        // Manually indenting all your code 4 more spaces.

Although these do render differently:

  • I'll start of a random list, then I'll try to use a code block here:
let theDevelopers = "have a break";

and

  • I'll start of a random list, then I'll try to use a code block here:

    let theDevelopers = "have a break";// Manually indenting all your code 4 more spaces.

My proposal is to replace the current functionality with two separate commands, one that indents, and one that dedents.


The main reason I wanted this to be fixed is because the button that creates the code block toggles, it doesn't append 4 lines every time. So if you truly want to use a code block in a list, you have to indent manually (which can be quite the task, if you're posting a lot of code).


As mentioned in the comments, this is not a duplicate of the question linked.... This is a feature request to make it so the button and CTRL+K work properly in lists, or add separate functions (probably easier) to intended / dedent,


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images