From c0eb4702535c85518af5c91fda4c393fe8d33334 Mon Sep 17 00:00:00 2001 From: Konstantin Schaper Date: Thu, 1 Jun 2023 11:14:17 +0200 Subject: [PATCH] allow lazy markdown view to support className --- scm-ui/ui-components/src/markdown/LazyMarkdownView.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scm-ui/ui-components/src/markdown/LazyMarkdownView.tsx b/scm-ui/ui-components/src/markdown/LazyMarkdownView.tsx index b26a7c913e..17bf4f54a6 100644 --- a/scm-ui/ui-components/src/markdown/LazyMarkdownView.tsx +++ b/scm-ui/ui-components/src/markdown/LazyMarkdownView.tsx @@ -49,9 +49,11 @@ import merge from "deepmerge"; import { createComponentList } from "./createComponentList"; import { ProtocolLinkRendererExtension, ProtocolLinkRendererExtensionMap } from "./markdownExtensions"; import styled from "styled-components"; +import classNames from "classnames"; export type MarkdownProps = { content: string; + className?: string; renderContext?: object; renderers?: any; skipHtml?: boolean; @@ -156,6 +158,7 @@ class LazyMarkdownView extends React.Component { basePath, permalink, t, + className, mdastPlugins = [], } = this.props; @@ -233,7 +236,10 @@ class LazyMarkdownView extends React.Component { return ( - this.setState({ contentRef: el })} className="content"> + this.setState({ contentRef: el })} + className={classNames("content", className)} + > {renderedMarkdown}