# Markdown editor: short guide Code Block Studio 1.8.4 brings optional code cards to Joplin's current **CodeMirror 6 Markdown editor**. Your notes stay ordinary Markdown. The existing Rich Text editor and Markdown preview keep their usual controls. ## Choose your view Open **Tools → Options → Code Block Studio** and enable **Render code blocks in the Markdown editor**. It defaults to off, so installing the update keeps the normal source view until you choose cards. Cards have syntax highlighting, Copy, Wrap, Format for supported languages, and the existing retro controls. Copy excludes display line numbers and decoration. ## Edit and return to a card - Choose **Edit source** to reopen the block at its previous editing position, or double-click a rendered code line to edit that line. Moving the cursor into a block or selecting across it also reveals source. - The opening and closing fence markers (usually three backticks) are part of Markdown: they mark the start/end of the code block. Both remain visible while editing. - **Format** and **View code card** stay in a fixed editor bar while you scroll long source. Choose **View code card** or press **Escape** to return at your reading position, including in the final block of a note. Clicking away also restores cards. Search and text selection handle Escape first. - The file-code button in Joplin's editor toolbar, or **Tools → Code Block Studio: Toggle code-block source**, switches all blocks between cards and source. Search temporarily reveals source so matches remain visible. ## Format from source Use **Format** in the source bar, or place the cursor inside a block and choose **Tools → Code Block Studio: Format current code block**. This command also works with cards turned off. Assign a shortcut in **Keyboard Shortcuts** if wanted; none is assigned by default. A complete fence and an explicit supported language, such as `python`, are required. Review the Original / Formatted comparison before choosing **Apply formatting**. Cancel and both Copy choices leave the note untouched. Applying updates only that block, keeps the nearest source line/column and supports normal editor Undo. ## Line numbers and memory Tick **Line numbers** in the source bar, or enable **Show code line numbers in Markdown source** in Code Block Studio options. These change the same saved preference, which defaults to off. Code lines count from 1 within each complete eligible block; fence markers and prose are unnumbered. Wrapped lines keep one number. Card line numbers have their own setting; neither inserts numbers into code. | What is remembered | How long | | --- | --- | | Editor-card and source-line-number preferences | Across Joplin restarts | | Code reading position, Markdown card/source choice and source caret when switching to/from Rich Text | App session, for the same unchanged block | | Individual card wrapping and editing positions | While that Markdown note/editor stays open | Display changes add no note edits or Undo steps. Changed blocks use Joplin's normal positioning. Retro choices remain saved with each block as before. ## Compatibility Requires **Joplin Desktop 3.7.22 or later**; native checks used 3.7.22 on Linux. Windows/macOS and custom editor-plugin combinations remain unverified; mobile is unsupported. The legacy Markdown editor retains its source view. Diagram fences, unclosed fences and blocks above 500,000 characters stay in source.