Loading
Follow mid-edit renames to Markdown in the "Preview" tab
What does this MR do and why?
Resolves "Preview" tab does not follow mid-edit file ren... (#616115 - closed), focusing on the preview selection.
Switch the "Preview" tab between the Markdown live preview and the rendered preview pane based on the Markdown extensions currently loaded in the editor, rather than the state captured at page load. The loaded extensions follow mid-edit renames, so the tab choice does too.
Scope
Making the preview renderer follow renames is covered in Follow mid-edit renames in the preview renderer (!251790 - merged).
- Add a spec asserting the "Preview" tab opens the Markdown live preview after a rename to Markdown
—
🔴 RED at this point due to the existing bug (job log) - Switch the pane based on the currently loaded Markdown extensions instead of the page-load
isMarkdownoption, turning it🟢 GREEN.
Related work
- Builds on Fix races between Markdown extension loading an... (!251306 - merged), which made the loaded-extension state
(
markdownExtensions) reliable enough to drive the tab choice from.
Screen recordings
Manually verified in GDK-in-a-box:
How to set up and validate locally
- In a repository, create a file named
foo.rstwith some reStructuredText content and commit it - Open
foo.rstin the single file editor - Rename it to
foo.mdand write some Markdown content - Click the "Preview" tab
- Verify that the content is rendered with the Markdown live preview
Notes
- 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