Improve "insert code block"

In the Add and Edit window, clicking the “Add Code Block” window causes the selected code to be formatted as code. There are three ways that I think this could be improved.

  1. When a section of text is converted to a code block, then it can be annoying to change it back. You either have to undo the changes with CTRL+Z (which is not available if you have saved the changes), go into the HTML and remove the <pre> tags manually, or delete the text and paste it without formatting. Could we replace “Add Code Block” with a “Toggle Code” button so that it behaves more like the italics and bold buttons by toggling the code formatting for the selected text?
  2. When a portion of a line is selected (instead of an entire line), can that text be wrapped with <code> blocks instead of <pre> so that the code remains in line?
  3. If the entire text is converted to code, then I would expect that hitting CTRL+A and DEL would clear everything, including the formatting, so I am left with a blank slate. Instead, the code formatting remains until BACKSPACE is hit in the empty text box.

That’s not built-in behaviour; you’re probably using an add-on.

1 Like

Ah, yes, you’re right. It’s provided by the Mini Format Pack add-on. I’ll contact the add-on developer.

1 Like