Throughout 2024, one of the top editorial requests has been shortcuts within the Sanity Portable Text Editor.
It's been a bit of a pain point and the one QOL productivity feature we think was missing.
Now, guess what dropped just before the end of the year.
So you know what that means: if you're not already using the auto-updating Sanity Studio, make sure you run:
npm i sanity@latest
Now we've got that up and running, let's move on to the cheat sheet. Keep reading to find out a pitfall we fell into when testing it for the first time.
Cheat Sheet
Here's a list of all the markdown shortcuts we've discovered so far. Everything highlighted on the left should be typed into the Sanity Portable Text field followed by a space
to change the formatting.
Headings
#
- Heading 1
##
- Heading 2
###
- Heading 3
####
- Heading 4
#####
- Heading 5
######
- Heading 6
Blockquote
>
- Blockquote
Lists
1.
- Ordered list
-
or *
- Unordered list
Pitfall to be aware of
If you're like us, you probably restricted <h1>
when you set up your Portable Text Editor for SEO reasons.
Naturally, the first thing you are going to test from the cheat sheet above is #
and then see if a Heading 1
appears...
This won't work if you're not including Heading 1
's in your configuration and you will get the same result as we did below.
![image-0e91841a3962d81be26e69101b7d41ccd6bcf0e5-1294x292-png](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fdcflm8sj%2Fproduction%2F0e91841a3962d81be26e69101b7d41ccd6bcf0e5-1294x292.png%3Fw%3D1294%26h%3D292%26fm%3Dwebp%26q%3D100%26fit%3Dmax%26auto%3Dformat&w=3840&q=75)
Make sure whatever markdown shortcut you're trying to use, actually exists inside of your Portable Text Editor.
Keyboard shortcuts exist as well
You may be aware of a couple of Markdown shortcuts we missed from above, specifically bold and italic. The good news is that they're in there, but with keyboard shortcuts instead.
For example, highlight some text and hit:
⌘ + B
- Make text bold
⌘ + I
- Make text italic
Bonus tip: full-screen Portable Text Editor
Things can easily become distracting if too many tabs are opened at once. For editorial zen, you can full-screen your Portable Text Editor.
You can do so by hitting the expand editor at the top right (or hitting ⌘ + ⏎ (enter)
) and clicking the top of each side panel to collapse them.
Thanks for reading
We've always said:
"Little incremental improvements are far more significant to the editorial experience than a singular big release."
That's why we love Sanity for their constant efforts with QOL improvements.