Code blocks

You can use UpNote to keep your library of code snippets or share them with others.

On desktop

To insert a code block on Mac or Windows, simply type 3 backticks ``` or click the code block icon in the formatting bar.

Syntax highlighting is supported for a number of programming languages. To change the display language of your code:

  • Right click on code block > Select Language

  • Select a programming language in the list

To wrap your code, go to Settings > Editor > enable Wrap code

On mobile

To insert a code block on iOS or Android, tap the + button in the formatting bar and select Code Block

To wrap your code, go to Settings > General > enable Wrap code


FAQ:

How to prevent the double dashes (--) to be turned into long dashes (—) in the code block on iOS?

This behavior is due to the default iOS “Smart Punctuation” feature, which automatically converts double dashes into long dashes. To prevent this, you can disable Smart Punctuation in your keyboard settings:

  1. Open the Settings app on your iPhone or iPad.

  2. Tap General.

  3. Scroll down and select Keyboard.

  4. In the “All Keyboards” section, find Smart Punctuation.

  5. Turn it off (the switch will turn gray).

Once disabled, double dashes will remain unchanged in your code blocks.

Last updated