forked from Gitlink/forgeplus-react
md文件要用Markdown渲染
This commit is contained in:
parent
ffbb5ba34e
commit
8fa31edaae
|
@ -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}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -295,6 +295,7 @@
|
|||
border-radius: 4px;
|
||||
.ant-dropdown-menu-item{
|
||||
border-radius: 8px;
|
||||
text-align: left;
|
||||
a{
|
||||
width: 350px;
|
||||
overflow: hidden;
|
||||
|
|
|
@ -281,7 +281,6 @@
|
|||
height:100%;
|
||||
}
|
||||
.files-md{
|
||||
border:1px solid #eee;
|
||||
padding:20px;
|
||||
}
|
||||
/* 详情-代码 */
|
||||
|
|
Loading…
Reference in New Issue