2025-01-09 12:32:24 +00:00
|
|
|
import { App, MarkdownPostProcessorContext } from "obsidian"
|
|
|
|
|
import { RendererRegistry } from "../renderer/rendererRegistry"
|
|
|
|
|
import { CodeblockProcessor } from "./CodeblockProcessor"
|
2025-08-10 08:34:54 +00:00
|
|
|
import { SqlSealDatabase } from "../../database/database"
|
|
|
|
|
import { Sync } from "../../sync/sync/sync"
|
|
|
|
|
import { Settings } from "../../settings/Settings"
|
|
|
|
|
import { ModernCellParser } from "../../syntaxHighlight/cellParser/ModernCellParser"
|
2025-01-09 12:32:24 +00:00
|
|
|
|
|
|
|
|
export class SqlSealCodeblockHandler {
|
|
|
|
|
constructor(
|
|
|
|
|
private readonly app: App,
|
|
|
|
|
private readonly db: SqlSealDatabase,
|
2025-08-10 08:34:54 +00:00
|
|
|
private readonly cellParser: ModernCellParser,
|
2025-01-09 12:32:24 +00:00
|
|
|
private sync: Sync,
|
2025-08-10 08:34:54 +00:00
|
|
|
private rendererRegistry: RendererRegistry,
|
|
|
|
|
private settings: Settings
|
2025-01-09 12:32:24 +00:00
|
|
|
) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getHandler() {
|
|
|
|
|
return async (source: string, el: HTMLElement, ctx: MarkdownPostProcessorContext) => {
|
|
|
|
|
const processor = new CodeblockProcessor(
|
|
|
|
|
el,
|
|
|
|
|
source,
|
|
|
|
|
ctx,
|
|
|
|
|
this.rendererRegistry,
|
|
|
|
|
this.db,
|
2025-08-10 08:34:54 +00:00
|
|
|
this.cellParser,
|
|
|
|
|
this.settings,
|
2025-01-09 12:32:24 +00:00
|
|
|
this.app,
|
|
|
|
|
this.sync
|
|
|
|
|
)
|
|
|
|
|
ctx.addChild(processor)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|