md文件要用Markdown渲染

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

View File

@ -230,6 +230,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}/>
@ -353,6 +357,7 @@ function CoderDepot(props){
{...props}
detail={fileInfo}
readOnly={readOnly}
md={mdFlag}
onEdit={onEdit}
currentBranch={branchName || (projectDetail && projectDetail.default_branch)}
type={projectDetail.type}

View File

@ -24,7 +24,7 @@ class CoderRootFileDetail extends Component {
}
componentDidMount = () => {
const { detail } = this.props;
const { detail , mdFlag } = this.props;
this.setState({
value: detail.content,
});
@ -176,9 +176,9 @@ class CoderRootFileDetail extends Component {
current_user,
isManager,
isDeveloper,
md,
currentBranch,
platform,
md,
type
} = this.props;
const { language, languages, description } = this.state;

View File

@ -295,6 +295,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;
}
/* 详情-代码 */