(embedEl: HTMLElement, plugin: CodeSpacePlugin)
| 332 | } |
| 333 | |
| 334 | function resolveSourcePathFromAncestors(embedEl: HTMLElement, plugin: CodeSpacePlugin): string { |
| 335 | for (let current: HTMLElement | null = embedEl; current; current = current.parentElement) { |
| 336 | for (const attrName of SOURCE_PATH_ATTR_CANDIDATES) { |
| 337 | const attrValue = current.getAttribute(attrName); |
| 338 | if (!attrValue) continue; |
| 339 | |
| 340 | const resolvedPath = normalizeSourcePathCandidate(attrValue, plugin); |
| 341 | if (resolvedPath) return resolvedPath; |
| 342 | } |
| 343 | } |
| 344 | |
| 345 | return ""; |
| 346 | } |
| 347 | |
| 348 | function disposeCodeEmbed(embedEl: HTMLElement) { |
| 349 | const ownerWindow = embedEl.ownerDocument.defaultView ?? window; |
no test coverage detected