Live preview: Better treatment of code blocks. Code Wrap, Horizontal Scroll and Smart Indent

Let me add here a quick note.
This is a much harder problem that it seems because there is only one real editor view. There are two options right now:

  1. It’s either as it is now. Codeblock flow and are editable with rest of the text.
  2. Use the same trick used for Tables (use reader rendering while not editing)

Specifically, codeblocks look like in reader (and you can have code wrap, horizontal scroll, prismjs highlight) but the moment you click anywhere to edit them they are “unpacked” to what you see now (with codemirror highlighting, no horizontal scroll, no code wrap).

We picked 1 over 2 because for codeblocks the gain you get is not worth the jarring effect.

5 Likes