md文件要用Markdown渲染

This commit is contained in:
caishi 2021-04-20 15:31:49 +08:00
parent 93ba9c6a98
commit 8a5a7a0647
4 changed files with 8 additions and 3 deletions

View File

@ -227,6 +227,10 @@ function CoderDepot(props){
}
})
}
let n = fileInfo && fileInfo.name;
const mdFlag = n && n.substring(n.length-3,n.length) === ".md";
return(
<WhiteBack>
<UpdateDescModal desc={desc} website={website} lesson_url={lesson_url} visible={openModal} onCancel={()=>setOpenModal(false)} onOk={okUpdate}/>
@ -346,6 +350,7 @@ function CoderDepot(props){
{...props}
detail={fileInfo}
readOnly={readOnly}
md={mdFlag}
onEdit={onEdit}
currentBranch={branchName || (projectDetail && projectDetail.default_branch)}
></CoderRootFileDetail>

View File

@ -176,9 +176,9 @@ class CoderRootFileDetail extends Component {
current_user,
isManager,
isDeveloper,
md,
currentBranch,
platform
platform,
md
} = this.props;
const { language, languages, description } = this.state;
let flag = current_user && current_user.login && (isManager || isDeveloper);

View File

@ -292,6 +292,7 @@
border-radius: 4px;
.ant-dropdown-menu-item{
border-radius: 8px;
text-align: left;
a{
width: 350px;
overflow: hidden;

View File

@ -281,7 +281,6 @@
height:100%;
}
.files-md{
border:1px solid #eee;
padding:20px;
}
/* 详情-代码 */