Adjust editor config (#976)

* Adjust editor config

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
Co-authored-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
Tilman Vatteroth 2021-02-03 22:13:04 +01:00 committed by GitHub
parent 0180c75e55
commit e12dc523f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
301 changed files with 4393 additions and 3741 deletions

View file

@ -33,14 +33,15 @@ export const BasicMarkdownRenderer: React.FC<BasicMarkdownRendererProps & Additi
onAfterRendering
}) => {
const maxLength = useSelector((state: ApplicationState) => state.config.maxDocumentLength)
const trimmedContent = useMemo(() => content.length > maxLength ? content.substr(0, maxLength) : content, [content, maxLength])
const trimmedContent = useMemo(() => content.length > maxLength ? content.substr(0, maxLength) : content, [content,
maxLength])
const markdownReactDom = useConvertMarkdownToReactDom(trimmedContent, markdownIt, componentReplacers, onBeforeRendering, onAfterRendering)
return (
<div className={`${className ?? ''} d-flex flex-column align-items-center`}>
<DocumentLengthLimitReachedAlert contentLength={content.length}/>
<div ref={documentReference} className={'markdown-body w-100 d-flex flex-column align-items-center'}>
{markdownReactDom}
<div className={ `${ className ?? '' } d-flex flex-column align-items-center` }>
<DocumentLengthLimitReachedAlert contentLength={ content.length }/>
<div ref={ documentReference } className={ 'markdown-body w-100 d-flex flex-column align-items-center' }>
{ markdownReactDom }
</div>
</div>
)