MCPcopy Index your code
hub / github.com/almariah/embed-code-file / insertTitlePreElement

Method insertTitlePreElement

main.ts:142–153  ·  view source on GitHub ↗
(pre: HTMLPreElement, title: string)

Source from the content-addressed store, hash-verified

140 }
141
142 insertTitlePreElement(pre: HTMLPreElement, title: string) {
143 pre
144 .querySelectorAll(".obsidian-embed-code-file")
145 .forEach((x) => x.remove());
146
147 let titleElement = document.createElement("pre");
148 titleElement.appendText(title);
149 titleElement.className = "obsidian-embed-code-file";
150 titleElement.style.color = this.settings.titleFontColor;
151 titleElement.style.backgroundColor = this.settings.titleBackgroundColor;
152 pre.prepend(titleElement);
153 }
154}

Callers 2

addTitleLivePreviewMethod · 0.95
addTitleMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected