- const html = this.markdownType === 'text' ?
- await this.markdownService.textMarkdownToHTML(text) :
- await this.markdownService.enhancedMarkdownToHTML(text)
+ let html: string
+
+ if (this.customMarkdownRenderer) {
+ const result = await this.customMarkdownRenderer(text)
+
+ if (result instanceof HTMLElement) {
+ const wrapperElement = this.previewElement.nativeElement as HTMLElement
+ wrapperElement.innerHTML = ''
+ wrapperElement.appendChild(result)
+ return
+ }
+
+ html = result
+ } else if (this.markdownType === 'text') {
+ html = await this.markdownService.textMarkdownToHTML(text)
+ } else {
+ html = await this.markdownService.enhancedMarkdownToHTML(text)
+ }
+
+ if (this.markdownVideo) {
+ html = this.markdownService.processVideoTimestamps(this.markdownVideo.shortUUID, html)
+ }