fix: markdown component (#469)

This commit is contained in:
金昶 2022-06-05 09:01:27 +08:00 committed by GitHub
parent d6d14459ed
commit 7760cd0891
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 7 deletions

View File

@ -44,11 +44,10 @@ ReadPretty.TextArea = (props) => {
/> />
); );
console.log('value', value); console.log('value', value);
const content = ( const content = ellipsis ?
<EllipsisWithTooltip ellipsis={ellipsis} popoverContent={autop ? html : value}> (<EllipsisWithTooltip ellipsis={ellipsis} popoverContent={autop ? html : value}>
{ellipsis ? text || value : html} {text}
</EllipsisWithTooltip> </EllipsisWithTooltip>) : value || html;
);
return ( return (
<div className={cls(prefixCls, props.className)} style={props.style}> <div className={cls(prefixCls, props.className)} style={props.style}>
{props.addonBefore} {props.addonBefore}

View File

@ -20,8 +20,8 @@ export const Markdown: any = connect(
}), }),
mapReadPretty((props) => { mapReadPretty((props) => {
let text = convertToText(props.value); let text = convertToText(props.value);
let value = <div className={'nb-markdown'} dangerouslySetInnerHTML={{ __html: markdown(text) }} />; let value = <div className={'nb-markdown'} dangerouslySetInnerHTML={{ __html: markdown(props.value) }} />;
return <InputReadPretty.TextArea {...props} text={text} value={value} />; return <InputReadPretty.TextArea {...props} autop={false} text={text} value={value} />;
}), }),
); );