From f62c9489ceb33dfa1c7071edd372d710e22f8a4c Mon Sep 17 00:00:00 2001 From: Tilman Vatteroth Date: Thu, 13 Apr 2023 19:01:00 +0200 Subject: [PATCH] fix: exclude first headline extraction from simple renderer Signed-off-by: Tilman Vatteroth --- .../extract-first-headline-app-extension.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/src/components/markdown-renderer/extensions/extract-first-headline/extract-first-headline-app-extension.ts b/frontend/src/components/markdown-renderer/extensions/extract-first-headline/extract-first-headline-app-extension.ts index 9026c0638..1ac658cdf 100644 --- a/frontend/src/components/markdown-renderer/extensions/extract-first-headline/extract-first-headline-app-extension.ts +++ b/frontend/src/components/markdown-renderer/extensions/extract-first-headline/extract-first-headline-app-extension.ts @@ -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)] }