Support Markdown live preview for snippet file editor
What does this MR do and why?
Implements Snippet file editor should support preview (#602250) for Markdown live preview.
Scope
Other file formats are out of scope.
Approach
Borrowed from existing codebase:
| Implementation | Reference |
|---|---|
| Registering editor extension | Repository file editor |
| Propagating preview path | Snippet description field |
| Matching Markdown extension | Blob viewer |
Screenshots
Manually verified on GDK-in-a-box.
Scope
No Write/Preview tab UI.
How to set up and validate locally
- Click "New snippet".
- Add one
.mdfile and one.rbfile with some content, then "Create snippet". - Open the "Edit" page for the snippet.
- Right-click inside the
.mdfile's editor and select Preview Markdown. - Confirm a preview panel appears next to the editor.
- Confirm the
.rbfile's right-click menu does not show Preview Markdown.
Notes
- No docs updates included — this area isn't well covered by existing documentation. If there are specific docs that should be updated, please flag them.
- I don't work on the frontend regularly — a careful look at this approach would be very helpful.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by skkzsh
