Unverified Commit 7760cd08 authored by 金昶's avatar 金昶 Committed by GitHub
Browse files

fix: markdown component (#469)

parent d6d14459
main 0.7 0.7.6 Dunqing-feat-select-m2o-next audit-logs auditlogs changed-with-associations chore/error-message doc/api-database doc/db-repository doc/dev-res-action doc/new-user-manual doc/plugin-workflow doc/relation-repository example/custom-signup-page example/util examples excel-function feat-add-block-title-feature feat-add-default-sort feat-association-field-block feat-association-field-features feat-default-value feat-fix-time-and-collection-pagination feat-fk-input feat-form-validator feat-kanban-add-description feat-m2o-sub-form-mode feat-record-block-initializers-fields-pick feat-relation-field-uischema feat/associate-operate feat/batch-operation feat/cache feat/changed-with-associations feat/collection-inherits feat/collection-templates feat/database feat/dev-ci feat/field-unique feat/grap-collection feat/inherit-collection feat/logger feat/plugin-export feat/plugin-file-manager feat/plugin-import feat/plugin-import-2 feat/plugin-manager-0823 feat/plugin-user-groups feat/plugin-verification feat/plugin-workflow-collection-field feat/pm feat/pnpm-support feat/reference-check feat/request-logs feat/resize-grid-columns feat/safer-update feat/submodule-graph-collection feat/tree-table-block feat/workflow-request fix-formula-bug fix-link-to-default-value fix-template-with-fields-only fix/association-deleted fix/attachment-upload fix/block-select-collection-menu fix/bulk-update-db-locked fix/collection-manager fix/collection-manager-0719 fix/collection-manager-del-foreign-key fix/create-inherits fix/custom-assign-value fix/database-find-with-appends fix/database-view-error fix/destroy-fields-by-array fix/docker-ci fix/export-date fix/export-percent fix/form-sys-fields-default-edit-mode fix/menu-schema fix/merge-include fix/plugin-cm fix/table-data fix/table-field-overflow perf/cache-schema perf/token pre-release refactor/client refactor/plugin-workflow refactor/plugin-workflow-ui rollback table-demo tree tree-demo v0.8.0-alpha.13 v0.8.0-alpha.11 v0.8.0-alpha.9 v0.8.0-alpha.8 v0.8.0-alpha.7 v0.8.0-alpha.6 v0.8.0-alpha.5 v0.8.0-alpha.3 v0.8.0-alpha.2 v0.8.0-alpha.1 v0.7.7-alpha.1 v0.7.6-alpha.2 v0.7.5-alpha.1.1666403334 v0.7.5-alpha.1 v0.7.4-alpha.7 v0.7.4-alpha.4 v0.7.4-alpha.1 v0.7.3-alpha.1 v0.7.2-alpha.2 v0.7.2-alpha.1 v0.7.1-alpha.5 v0.7.1-alpha.4
No related merge requests found
Showing with 6 additions and 7 deletions
+6 -7
......@@ -44,11 +44,10 @@ ReadPretty.TextArea = (props) => {
/>
);
console.log('value', value);
const content = (
<EllipsisWithTooltip ellipsis={ellipsis} popoverContent={autop ? html : value}>
{ellipsis ? text || value : html}
</EllipsisWithTooltip>
);
const content = ellipsis ?
(<EllipsisWithTooltip ellipsis={ellipsis} popoverContent={autop ? html : value}>
{text}
</EllipsisWithTooltip>) : value || html;
return (
<div className={cls(prefixCls, props.className)} style={props.style}>
{props.addonBefore}
......
......@@ -20,8 +20,8 @@ export const Markdown: any = connect(
}),
mapReadPretty((props) => {
let text = convertToText(props.value);
let value = <div className={'nb-markdown'} dangerouslySetInnerHTML={{ __html: markdown(text) }} />;
return <InputReadPretty.TextArea {...props} text={text} value={value} />;
let value = <div className={'nb-markdown'} dangerouslySetInnerHTML={{ __html: markdown(props.value) }} />;
return <InputReadPretty.TextArea {...props} autop={false} text={text} value={value} />;
}),
);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment