fix: exclude first headline extraction from simple renderer

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2023-04-13 19:01:00 +02:00
parent cfdf69869c
commit f62c9489ce
No known key found for this signature in database
GPG key ID: 42498463316F048B

View file

@ -5,6 +5,7 @@
*/
import type { MarkdownRendererExtensionOptions } from '../../../../extensions/base/app-extension'
import { AppExtension } from '../../../../extensions/base/app-extension'
import { RendererType } from '../../../render-page/window-post-message-communicator/rendering-message'
import type { MarkdownRendererExtension } from '../base/markdown-renderer-extension'
import { ExtractFirstHeadlineEditorExtension } from './extract-first-headline-editor-extension'
import { ExtractFirstHeadlineMarkdownExtension } from './extract-first-headline-markdown-extension'
@ -14,6 +15,9 @@ import { ExtractFirstHeadlineMarkdownExtension } from './extract-first-headline-
*/
export class ExtractFirstHeadlineAppExtension extends AppExtension {
buildMarkdownRendererExtensions(options: MarkdownRendererExtensionOptions): MarkdownRendererExtension[] {
if (options.rendererType === RendererType.SIMPLE) {
return []
}
return [new ExtractFirstHeadlineMarkdownExtension(options.eventEmitter)]
}