mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +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>
|
||||
|
|
|
@ -327,6 +327,7 @@
|
|||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
font-size: 6px;
|
||||
|
||||
&::after {
|
||||
content: ' ';
|
||||
|
|
|
@ -8,28 +8,29 @@
|
|||
right: 4px solid $red;
|
||||
}
|
||||
font-family: monospace;
|
||||
font-size: 13px;
|
||||
font-size: 0.9em;
|
||||
border-radius: $radius;
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
padding: $gap;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 0.3em;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
margin-bottom: $gap;
|
||||
margin-bottom: 0.3em;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-bottom: $gap;
|
||||
margin-bottom: 0.3em;
|
||||
}
|
||||
|
||||
h5, h4, h3, h2, h1 {
|
||||
color: white;
|
||||
font-weight: 800;
|
||||
line-height: 1.2em;
|
||||
margin-bottom: $gap;
|
||||
margin-bottom: 0.3em;
|
||||
}
|
||||
|
||||
h1 {
|
||||
|
@ -55,10 +56,10 @@
|
|||
ul {
|
||||
list-style: disc;
|
||||
padding-left: 20px;
|
||||
margin-bottom: $gap;
|
||||
margin-bottom: 0.3em;
|
||||
|
||||
li {
|
||||
margin: 5px 0;
|
||||
margin: 0.1em 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue