MCPcopy Index your code
hub / github.com/UNLINEARITY/Obsidian-CodeSpace / queueCodeEmbedsInElement

Function queueCodeEmbedsInElement

src/code_embed.ts:392–406  ·  view source on GitHub ↗
(rootEl: HTMLElement, plugin: CodeSpacePlugin, sourcePath: string)

Source from the content-addressed store, hash-verified

390}
391
392export function queueCodeEmbedsInElement(rootEl: HTMLElement, plugin: CodeSpacePlugin, sourcePath: string) {
393 if (!sourcePath) return;
394
395 ensureCodeSpaceStylesInDocument(rootEl.ownerDocument, plugin);
396 rememberSourcePath(rootEl, sourcePath);
397
398 const embeds = rootEl.classList.contains("file-embed")
399 ? [rootEl]
400 : Array.from(rootEl.querySelectorAll<HTMLElement>(".file-embed"));
401
402 for (const embedEl of embeds) {
403 rememberSourcePath(embedEl, sourcePath);
404 scheduleProcessCodeEmbed(embedEl, plugin, sourcePath);
405 }
406}
407
408function installPrintRefreshForDocument(doc: Document, docWindow: Window, plugin: CodeSpacePlugin) {
409 if (embedPrintRefreshByDoc.has(doc)) return;

Callers

nothing calls this directly

Calls 3

rememberSourcePathFunction · 0.85
scheduleProcessCodeEmbedFunction · 0.85

Tested by

no test coverage detected