Merge pull request #140 from satkowski/renderContext-update

Fix: added a new property to the render context: the file path the call originates from
This commit is contained in:
Kacper Kula 2025-04-10 10:00:45 +01:00 committed by GitHub
commit 85bb0e0afb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 3 deletions

View file

@ -73,7 +73,8 @@ export class CodeblockProcessor extends MarkdownRenderChild {
.prepareRender(
results.renderer.type.toLowerCase(), results.renderer.options
)(rendererEl, {
cellParser: this.plugin.cellParser
cellParser: this.plugin.cellParser,
sourcePath: this.ctx.sourcePath
})
// FIXME: probably should save the one before transform and perform transform every time we execute it.

View file

@ -7,7 +7,8 @@ export interface DataFormat {
}
export interface RendererContext {
cellParser: ModernCellParser
cellParser: ModernCellParser,
sourcePath: string
}
export interface RenderReturn {

View file

@ -276,7 +276,7 @@ export class CSVView extends TextFileView {
})
menu.showAtMouseEvent(e.event as any)
}
}, gridEl, { cellParser: this.cellParser })
}, gridEl, { cellParser: this.cellParser, sourcePath: this.file?.path || '' })
this.api = api;
this.loadDataIntoGrid()