Cleaner Mermaid flowcharts, centred diagrams
Decision branches now leave a flowchart's diamond from separate points, merge nodes sit centred between their parents, and every Mermaid diagram is centred in the page column.
Mermaid flowcharts got a visual pass in Markdown PDFs (and anywhere Markdown is rendered — the API, CLI and web app). Decision diamonds are the visible change: the "Yes" and "No" branches used to leave from the same spot underneath the diamond on a short shared bar, which read as a fork rather than two distinct exits. Each branch now leaves from the vertex its target points at — the left or right point when the target sits to that side of the diamond's centre, the forward point only when it is centred — and each vertex carries at most one edge, so the branches fan out to opposite sides instead of stacking up under the diamond.
Nodes with more than one incoming edge are placed centred between their parents now. In the classic Start → Decision → Process A / Process B → End shape, End sits midway under the two processes and both edges into it run short and direct, instead of one looping all the way across the diagram.
Mermaid figures are also centred horizontally in the content column when they are narrower than it. Diagrams that already fill the column are unaffected, and nothing is scaled up — a small diagram stays its natural size, just centred rather than hugging the left margin.
Alongside the decision and placement work, flowchart labels sit properly centred on the text baseline, edges use sharp orthogonal corners, edge labels sit on their routed line over a small knock-out so the line does not strike through them, and nodes use a higher-contrast neutral palette that stays readable in greyscale print. Sequence, class, state, ER, C4, requirement, pie and the other diagram types keep their existing look — their content is unchanged, and they pick up the centring too.
Re-render any document with a ```mermaid fence to see the new output.