10

Some issues with the new Stacks Editor's code block usage:

GIF illustrating issues

Had to make it a GIF to upload here but the video is supposed to stop when I press the discard button and click the off-screen confirm box.

Issues:

  • How do you exit the code block after entering? I have tried the key, pressing Enter multiple times, and pressing the code block button (Ctrl + M).
  • How do you add the lang-* part to the code block?
  • Two workarounds are shown for both issues.
    • Pressed Enter multiple times, then pressed until I got to the top, then typed ``` (auto converts to code block, you can use Ctrl + M or the button), my lang-* prefix, my code, and then ``` again. Pressed multiple times to get to the bottom again, typed out adfsasdfafsdasdf, deleted the extra newlines, and replaced adfsasdfafsdasdf with the real text.
    • The other workaround I found is to go in markdown mode, and type what you want that way.

It is very annoying when I am trying to type out answers to switch modes often.

1
  • 3
    For language selection in Rich Text mode specifically, as I understand it, it's been acknowledged as a planned feature, but it's not out yet. It's listed in the beta announcement under the TBD "Beta 3" heading with a linked to the original answer request on the alpha post marker as [status-planned], and tracked under this (open) GH issue.
    – zcoop98
    Commented Mar 14 at 16:24

1 Answer 1

4

We've now fixed the issue with exiting code blocks.

This was already working when you used the "code block" button in the toolbar - creating the code block creates an empty paragraph below, so you can use the down arrow to enter it. But this didn't work if you created the code block by entering three backticks. That's fixed now.

We're looking into adding some UI to let you specify the language without having to switch over to Markdown mode.

3
  • 2
    Thanks, but I'm curious, how this got handled when this isn't in your internal backlog? (i.e. there is no status-review tag on this bug report.)
    – user152859
    Commented Mar 19 at 11:50
  • 1
    My magic 8ball says bug squish + added focus on the new editor + checking the tags. Commented Mar 19 at 12:00
  • 1
    It's also possible someone else reported it on MSO or on GitHub directly, even though this particular MSE post wasn't given the [status-review] tag originally.
    – V2Blast
    Commented Mar 20 at 19:43

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.