(tableEl)
| 195 | const GITHUB_BASE = "https://github.com/Cosmian/kms/blob"; |
| 196 | |
| 197 | function getCratePath(tableEl) { |
| 198 | // Walk backwards from the table to find the nearest "Crate path: `...`" paragraph. |
| 199 | let node = tableEl.previousElementSibling; |
| 200 | while (node) { |
| 201 | if (node.tagName === "P" || node.tagName === "DIV") { |
| 202 | const text = node.textContent || ""; |
| 203 | if (text.includes("Crate path:")) { |
| 204 | const code = node.querySelector("code"); |
| 205 | if (code) return code.textContent.trim().replace(/\/$/, ""); |
| 206 | } |
| 207 | } |
| 208 | // Stop at section headings |
| 209 | if (node.tagName === "H2" || node.tagName === "H3") break; |
| 210 | node = node.previousElementSibling; |
| 211 | } |
| 212 | return null; |
| 213 | } |
| 214 | |
| 215 | function linkifyFileCells(content) { |
| 216 | const version = (window.KMS_VERSION || "develop").trim(); |
no test coverage detected