mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
added markdown to flow cells
This commit is contained in:
parent
c98ac8b597
commit
52d5b57245
3 changed files with 19 additions and 8 deletions
|
@ -4,6 +4,7 @@ import { formatCellText, getURL } from '~/utils/dom';
|
|||
import classNames from 'classnames';
|
||||
|
||||
import styles from './styles.module.scss';
|
||||
import markdown from '~/styles/common/markdown.module.scss';
|
||||
import { Icon } from '~/components/input/Icon';
|
||||
import { flowSetCellView } from '~/redux/flow/actions';
|
||||
import { PRESETS } from '~/constants/urls';
|
||||
|
@ -119,6 +120,8 @@ const Cell: FC<IProps> = ({
|
|||
}
|
||||
}, [title]);
|
||||
|
||||
const cellText = useMemo(() => formatCellText(text), [text]);
|
||||
|
||||
return (
|
||||
<div className={classNames(styles.cell, styles[(flow && flow.display) || 'single'])} ref={ref}>
|
||||
{is_visible && (
|
||||
|
@ -150,7 +153,10 @@ const Cell: FC<IProps> = ({
|
|||
<div className={styles.text}>
|
||||
{title && <div className={styles.text_title}>{title}</div>}
|
||||
|
||||
<Group dangerouslySetInnerHTML={{ __html: formatCellText(text) }} />
|
||||
<div
|
||||
dangerouslySetInnerHTML={{ __html: cellText }}
|
||||
className={markdown.wrapper}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
@ -158,7 +164,10 @@ const Cell: FC<IProps> = ({
|
|||
<div className={styles.text_only}>
|
||||
{title && <div className={styles.text_title}>{title}</div>}
|
||||
|
||||
<Group dangerouslySetInnerHTML={{ __html: formatCellText(text) }} />
|
||||
<div
|
||||
dangerouslySetInnerHTML={{ __html: cellText }}
|
||||
className={markdown.wrapper}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue