MCPcopy Create free account
hub / github.com/UNLINEARITY/Obsidian-CodeSpace / buildExpandedMarkdown

Function buildExpandedMarkdown

src/native_pdf_export_patch.ts:117–135  ·  view source on GitHub ↗
(
	plugin: CodeSpacePlugin,
	view: MutableMarkdownView | null,
	sourceFile: TFile,
	fallbackMarkdown: string
)

Source from the content-addressed store, hash-verified

115}
116
117async function buildExpandedMarkdown(
118 plugin: CodeSpacePlugin,
119 view: MutableMarkdownView | null,
120 sourceFile: TFile,
121 fallbackMarkdown: string
122): Promise<string> {
123 const sourceMarkdown =
124 view?.file?.path === sourceFile.path ? view.getViewData() : fallbackMarkdown;
125
126 try {
127 return await expandCodeEmbedsInMarkdown(plugin, sourceMarkdown, sourceFile);
128 } catch (error) {
129 warnNativePdf(activeNativeExportSession, "failed to expand markdown for native export", {
130 file: sourceFile.path,
131 error,
132 });
133 return fallbackMarkdown;
134 }
135}
136
137function cleanupActiveNativeExportSession() {
138 activeNativeExportSession?.cleanup();

Callers 1

Calls 3

warnNativePdfFunction · 0.85
getViewDataMethod · 0.80

Tested by

no test coverage detected