feature_render_mermaid #6

Merged
nocyphr merged 14 commits from feature_render_mermaid into master 2026-05-23 13:31:10 +03:00
Owner
No description provided.
nocyphr self-assigned this 2026-05-23 13:30:07 +03:00
add feature file and update docs with new feature description
Some checks failed
CI / ci (push) Failing after 46s
CI / publish (push) Has been skipped
c0f55d6215
red: add step definitions
Some checks failed
CI / ci (push) Failing after 28s
CI / publish (push) Has been skipped
68b12fb35f
green: add stubs to jsdom worldts, implement logic
Some checks failed
CI / ci (push) Failing after 29s
CI / publish (push) Has been skipped
6539964760
green: add wiring, fallback on renderfailure, make async, fix unittests
Some checks failed
CI / ci (push) Failing after 39s
CI / publish (push) Has been skipped
af65478f45
green: add steps for existing logic
Some checks failed
CI / ci (push) Failing after 39s
CI / publish (push) Has been skipped
8a38647910
refactor: fix coverage
Some checks failed
CI / ci (push) Failing after 2m55s
CI / publish (push) Has been skipped
fa571dcb18
update: kill the mutants - no survivors
All checks were successful
CI / ci (push) Successful in 2m50s
CI / publish (push) Successful in 2s
cc9400ab95
add: releasenotes template
All checks were successful
CI / ci (push) Successful in 2m52s
CI / publish (push) Successful in 1s
CI / ci (pull_request) Successful in 2m54s
CI / publish (pull_request) Successful in 2s
a16d683b38
nocyphr merged commit 62f2171eda into master 2026-05-23 13:31:10 +03:00
nocyphr deleted branch feature_render_mermaid 2026-05-23 13:31:10 +03:00
Author
Owner

What's new

Mermaid diagram rendering

Fenced mermaid code blocks in the preview are now rendered as live SVG diagrams. Write a diagram definition in your markdown and it appears as a rendered graphic in the right-hand pane — no extra steps required.

```mermaid
graph TD
  A[Write markdown] --> B[Live SVG preview]
```

Graceful fallback

If the diagram definition contains a syntax error, the original fenced code block is preserved as-is. The rest of the preview is unaffected.


Changes

  • New module src/lib/diagrams.ts — locates language-mermaid code blocks and replaces them with the SVG returned by mermaid.render()
  • applyPreviewEffects (src/lib/preview.ts) is now async to accommodate the diagram render step
  • App.svelte updated to handle the async preview pipeline
  • Added mermaid npm dependency

Quality

  • 3 new BDD scenarios: happy-path rendering, pipeline wiring, invalid-syntax fallback
  • Mutation score: 100% (269 mutants tested, up from 177)

Full diff: master...feature_render_mermaid

## What's new ### Mermaid diagram rendering Fenced `mermaid` code blocks in the preview are now rendered as live SVG diagrams. Write a diagram definition in your markdown and it appears as a rendered graphic in the right-hand pane — no extra steps required. ````markdown ```mermaid graph TD A[Write markdown] --> B[Live SVG preview] ``` ```` ### Graceful fallback If the diagram definition contains a syntax error, the original fenced code block is preserved as-is. The rest of the preview is unaffected. --- ## Changes - New module `src/lib/diagrams.ts` — locates `language-mermaid` code blocks and replaces them with the SVG returned by `mermaid.render()` - `applyPreviewEffects` (`src/lib/preview.ts`) is now async to accommodate the diagram render step - `App.svelte` updated to handle the async preview pipeline - Added `mermaid` npm dependency --- ## Quality - 3 new BDD scenarios: happy-path rendering, pipeline wiring, invalid-syntax fallback - Mutation score: **100%** (269 mutants tested, up from 177) --- **Full diff:** `master...feature_render_mermaid`
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nocyphr/md-to-pdf!6
No description provided.