Member-only story

Medium’s New Code Blocks Need Fixing

# Please

Liu Zuo Lin
2 min readNov 29, 2022
Obviously I’m writing CSS code

You’ve probably noticed this if you write technical articles on Medium that require you to write code. For instance:

print('hello world')

For those of you who are not familiar with this, hit either

  • Command-Option-6 for MacOS
  • Control-Alt-6 for Windows

And a code block will appear.

Old Code Blocks VS New Code Blocks

Old Code Blocks

  • only 1 colour (black)
  • we couldn’t hit tab to add multiple spaces

New Code Blocks

  • Different colours for different keywords for different programming languages
  • What programming language you’re using can be auto-detected (or chosen manually)
  • We can input multiple spaces now using the tab key which is nice (previously we had to hit space multiple times)

The Problem

The programming language detection sucks.

Which means that we have to MANUALLY change the programming language of each block.

Next, I’m going to write a bunch of Python code without manually changing the detected language.

--

--

Liu Zuo Lin
Liu Zuo Lin

Written by Liu Zuo Lin

SWE @ Meta | [Ebook] 101 Things I Never Knew About Python: https://payhip.com/b/vywcf

No responses yet