( plugin: CodeSpacePlugin, view: MutableMarkdownView | null, sourceFile: TFile, fallbackMarkdown: string )
| 115 | } |
| 116 | |
| 117 | async 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 | |
| 137 | function cleanupActiveNativeExportSession() { |
| 138 | activeNativeExportSession?.cleanup(); |
no test coverage detected