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.

snippet-live-preview

Scope

No Write/Preview tab UI.

How to set up and validate locally

  1. Click "New snippet".
  2. Add one .md file and one .rb file with some content, then "Create snippet".
  3. Open the "Edit" page for the snippet.
  4. Right-click inside the .md file's editor and select Preview Markdown.
  5. Confirm a preview panel appears next to the editor.
  6. Confirm the .rb file'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

Merge request reports

Loading