|
228 | 228 | parent.replaceChild(frag, textNode); |
229 | 229 | }); |
230 | 230 |
|
231 | | - // Debug: log labelBox SVG structure to console for inspection. |
232 | | - svg.querySelectorAll(".labelBox").forEach(function(box, i) { |
233 | | - var g = box.closest("g"); |
234 | | - if (!g) return; |
235 | | - var text = g.querySelector(".labelText"); |
236 | | - if (!text) return; |
237 | | - console.log("labelBox[" + i + "]:", { |
238 | | - boxY: box.getAttribute("y"), |
239 | | - boxH: box.getAttribute("height"), |
240 | | - boxW: box.getAttribute("width"), |
241 | | - textY: text.getAttribute("y"), |
242 | | - textDY: text.getAttribute("dy"), |
243 | | - textDomBaseline: text.getAttribute("dominant-baseline"), |
244 | | - textBBox: text.getBBox(), |
245 | | - tspans: Array.from(text.querySelectorAll("tspan")).map(function(ts) { |
246 | | - return { y: ts.getAttribute("y"), dy: ts.getAttribute("dy"), text: ts.textContent }; |
247 | | - }), |
248 | | - outerHTML: g.outerHTML.substring(0, 500) |
249 | | - }); |
250 | | - }); |
251 | | - |
252 | 231 | // Widen note rects when monospace text overflows the original box. |
253 | 232 | svg.querySelectorAll(".note").forEach(function(noteRect) { |
254 | 233 | var g = noteRect.closest("g"); |
|
276 | 255 | } |
277 | 256 | }); |
278 | 257 | }); |
| 258 | + |
| 259 | +// Debug: dump labelBox structure from all mermaid containers. |
| 260 | +document.querySelectorAll("pre.mermaid").forEach(function(pre, pi) { |
| 261 | + var labels = pre.querySelectorAll("[class*='label'], [class*='loop']"); |
| 262 | + console.log("mermaid[" + pi + "] label/loop elements:", labels.length); |
| 263 | + labels.forEach(function(el, i) { |
| 264 | + console.log(" [" + i + "]", el.tagName, el.getAttribute("class"), |
| 265 | + "y=" + el.getAttribute("y"), |
| 266 | + "h=" + el.getAttribute("height"), |
| 267 | + el.outerHTML.substring(0, 300)); |
| 268 | + }); |
| 269 | +}); |
279 | 270 | </script> |
280 | 271 |
|
281 | 272 | {{ partial "theme-toggle.html" . }} |
|
0 commit comments