feature_render_plantuml #8

Merged
nocyphr merged 9 commits from feature_render_plantuml into master 2026-05-23 15:30:02 +03:00
Owner

What's new

PlantUML diagram rendering

Fenced ```plantuml blocks are now rendered as live SVG diagrams in the preview pane, alongside the existing Mermaid support. The diagram is fetched from the plantuml.com SVG endpoint. If the request fails or the syntax is invalid, the original code block is left in place.

```plantuml
@startuml
Alice -> Bob : Hello
Bob --> Alice : Hi!
@enduml
` ` `

Changes

  • Added plantuml-encoder dependency and type declaration (src/lib/plantuml-encoder.d.ts) — encodes PlantUML source to the URL format expected by plantuml.com
  • Added renderPlantUmlBlock private helper in diagrams.ts — fetches SVG from plantuml.com, replaces the <pre> on success, throws on non-ok response (caught silently by renderDiagrams)
  • Extracted renderMermaidBlocks from renderDiagrams — reduces cyclomatic complexity to satisfy fallow's threshold
  • Removed unused @highlightjs/cdn-assets dependency
  • Refactored diagram_rendering.feature from 3 individual Mermaid scenarios to 3 Scenario Outlines covering both Mermaid and PlantUML

Quality

  • BDD: PlantUML render success, render via preview pipeline, and invalid-syntax fallback all covered by the new Scenario Outlines
  • Stryker: 100.00% mutation score — 0 survivors; 1 StringLiteral suppressed (error message always swallowed by caller, not observable through public API)
  • fallow: 0 unused deps · 0 complexity violations · 0 duplication

Full diff: master...feature_render_plantuml

# What's new ## PlantUML diagram rendering Fenced ` ```plantuml ` blocks are now rendered as live SVG diagrams in the preview pane, alongside the existing Mermaid support. The diagram is fetched from the plantuml.com SVG endpoint. If the request fails or the syntax is invalid, the original code block is left in place. ```markdown ```plantuml @startuml Alice -> Bob : Hello Bob --> Alice : Hi! @enduml ` ` ` ``` --- # Changes - Added `plantuml-encoder` dependency and type declaration (`src/lib/plantuml-encoder.d.ts`) — encodes PlantUML source to the URL format expected by plantuml.com - Added `renderPlantUmlBlock` private helper in `diagrams.ts` — fetches SVG from plantuml.com, replaces the `<pre>` on success, throws on non-ok response (caught silently by `renderDiagrams`) - Extracted `renderMermaidBlocks` from `renderDiagrams` — reduces cyclomatic complexity to satisfy fallow's threshold - Removed unused `@highlightjs/cdn-assets` dependency - Refactored `diagram_rendering.feature` from 3 individual Mermaid scenarios to 3 Scenario Outlines covering both Mermaid and PlantUML --- # Quality - BDD: PlantUML render success, render via preview pipeline, and invalid-syntax fallback all covered by the new Scenario Outlines - Stryker: 100.00% mutation score — 0 survivors; 1 `StringLiteral` suppressed (error message always swallowed by caller, not observable through public API) - fallow: 0 unused deps · 0 complexity violations · 0 duplication --- **Full diff:** `master...feature_render_plantuml`
nocyphr self-assigned this 2026-05-23 15:28:17 +03:00
Merge branch 'master' into feature_render_plantuml
All checks were successful
CI / ci (push) Successful in 3m7s
CI / ci (pull_request) Successful in 3m4s
CI / publish (push) Successful in 1s
CI / publish (pull_request) Successful in 1s
3e79f0956a
nocyphr merged commit ea9d2f513e into master 2026-05-23 15:30:02 +03:00
nocyphr deleted branch feature_render_plantuml 2026-05-23 15:30:02 +03:00
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!8
No description provided.