-
So in a text block when I insert images I get those 2 helper buttons to insert a paragraph before or after the image which is pretty handy because if otherwise you didn't leave blank lines it's impossible to insert paragraphs easily. This feature doesn't seem to work when I insert a code block. It would be pretty handy to have those helpers as well because inserting a paragraph before a code block is a nightmare. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This is a known limitation due to how code blocks are implemented in Trilium Notes using CKEditor. Images use native CKEditor features that provide helper buttons for inserting paragraphs before or after, but code blocks are handled differently—Trilium uses a custom CKEditor plugin with CodeMirror for code blocks, which doesn't include those helper buttons. As a result, inserting paragraphs before or after a code block can be tricky and is not as seamless as with images. Workarounds include: selecting and dragging a piece of text above the code block, or using keyboard shortcuts like Ctrl+Home, Enter, Up Arrow, Enter to insert a blank line before the code block. You can also place the cursor at the start of the code block and press Enter twice to create a paragraph before it, or at the end and press Enter three times to create one after it. These methods are documented in CKEditor’s official docs and discussed in Trilium’s support threads [source 1] [source 2]. There’s no setting or feature in Trilium to add the helper buttons for code blocks at this time. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
This is a known limitation due to how code blocks are implemented in Trilium Notes using CKEditor. Images use native CKEditor features that provide helper buttons for inserting paragraphs before or after, but code blocks are handled differently—Trilium uses a custom CKEditor plugin with CodeMirror for code blocks, which doesn't include those helper buttons. As a result, inserting paragraphs before or after a code block can be tricky and is not as seamless as with images.
Workarounds include: selecting and dragging a piece of text above the code block, or using keyboard shortcuts like Ctrl+Home, Enter, Up Arrow, Enter to insert a blank line before the code block. You can also place the cu…