diff --git a/ui/component/common/markdown-preview.jsx b/ui/component/common/markdown-preview.jsx index 854735c49..86de3a60e 100644 --- a/ui/component/common/markdown-preview.jsx +++ b/ui/component/common/markdown-preview.jsx @@ -1,5 +1,6 @@ // @flow import * as React from 'react'; +import classnames from 'classnames'; import remark from 'remark'; import remarkAttr from 'remark-attr'; import remarkStrip from 'strip-markdown'; @@ -29,6 +30,7 @@ type MarkdownProps = { content: ?string, promptLinks?: boolean, noDataStore?: boolean, + className?: string, }; const SimpleText = (props: SimpleTextProps) => { @@ -97,7 +99,7 @@ schema.attributes.a.push('embed'); const REPLACE_REGEX = /(<\/iframe>)/g; const MarkdownPreview = (props: MarkdownProps) => { - const { content, strip, promptLinks, noDataStore } = props; + const { content, strip, promptLinks, noDataStore, className } = props; const strippedContent = content ? content.replace(REPLACE_REGEX, (iframeHtml, y, iframeSrc) => { // Let the browser try to create an iframe to see if the markup is valid @@ -151,7 +153,7 @@ const MarkdownPreview = (props: MarkdownProps) => { } return ( -
+
{ remark() .use(remarkAttr, remarkAttrOpts) diff --git a/ui/component/fileDescription/view.jsx b/ui/component/fileDescription/view.jsx index fc307dad5..68dd89237 100644 --- a/ui/component/fileDescription/view.jsx +++ b/ui/component/fileDescription/view.jsx @@ -32,7 +32,7 @@ class FileDescription extends PureComponent { <> {description && (
- +
)} diff --git a/ui/scss/component/_markdown-preview.scss b/ui/scss/component/_markdown-preview.scss index 98a83eecc..be01a75d3 100644 --- a/ui/scss/component/_markdown-preview.scss +++ b/ui/scss/component/_markdown-preview.scss @@ -20,6 +20,7 @@ h6 { font-size: inherit; margin-bottom: var(--spacing-m); + font-weight: bold; &:not(:first-child) { margin-top: var(--spacing-l); @@ -45,6 +46,27 @@ font-size: 1em; } + &.markdown-preview--description { + h1 { + font-size: 1.2em; + } + h2 { + font-size: 1.1em; + } + h3 { + font-size: 1em; + } + h4 { + font-size: 0.9em; + } + h5 { + font-size: 0.8em; + } + h6 { + font-size: 0.7em; + } + } + dl, ul, ol,