代码库一级页面提交描述信息md渲染

This commit is contained in:
谢思 2021-10-11 21:20:08 +08:00
parent 208c1de930
commit 66c5662d01
4 changed files with 13 additions and 6 deletions

View File

@ -22,6 +22,7 @@ import UpdateDescModal from './sub/UpdateDescModal';
import Nodata from '../Nodata';
import Invite from './sub/Invite';
import CheckProfile from '../Component/ProfileModal/Profile';
import RenderHtml from '../../components/render-html';
/**
* projectDetail.type:0是托管项目1是镜像项目2是同步镜像项目(为2时不支持在线创建在线上传在线修改在线删除创建合并请求等功能)
*/
@ -196,7 +197,7 @@ function CoderDepot(props){
let ele = document.getElementById("ptxt");
if(ele){
let h = ele.offsetHeight;
if( h > 18 ) setHideBtn(true);
if( h > 33 ) setHideBtn(true);
}
}
},[projectDetail,lastCommit])
@ -457,7 +458,7 @@ function CoderDepot(props){
<div className="listtablehead">
<User url={getImageUrl(`/${lastCommitAuthor && lastCommitAuthor.image_url}`)} name={lastCommitAuthor && lastCommitAuthor.name} id={lastCommitAuthor && lastCommitAuthor.id} login={lastCommitAuthor && lastCommitAuthor.login}/>
<div className={hideBtn && hide ? "ellipsistxt hidetxt" :"ellipsistxt"}>
<pre id="ptxt"><Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(lastCommit.sha)}`}>{lastCommit.message}</Link></pre>
<pre id="ptxt"><Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(lastCommit.sha)}`}><RenderHtml value={lastCommit.message}/></Link></pre>
</div>
{ hideBtn && <span className="ellipsis" onClick={()=>changeHide(hide)}><i className="iconfont icon-shenglvehao"></i></span> }

View File

@ -86,7 +86,7 @@ export default (props) => {
<div className="f-wrap-between">
<div>
{commit && commit.message &&
<RenderHtml className="task-hide" value={commit.message} url={history.location} />
<RenderHtml className="task-hide" value={commit.message}/>
}
<Link to={`/${owner}/${projectsId}/tree/${truncateCommitId(sha)}`}><i className="iconfont icon-fenzhi2 font-18"></i>{data.branch}</Link>
</div>

View File

@ -252,7 +252,13 @@
border: 1px solid rgba(42, 97, 255, 0.23);
background-color: #FAFCFF;
.ellipsistxt{
margin-top: 6px;
.markdown-body{
line-height: 8px;
& p {
margin: 0 0px !important;
}
}
margin-top: 2px;
// cursor: pointer;
#ptxt{
margin-bottom: 0px;
@ -270,7 +276,7 @@
width: 0;
color: #666;
&.hidetxt{
height: 18px;
height: 22px;
overflow: hidden;
position: relative;
padding-right:8px;

View File

@ -104,7 +104,7 @@ ul,ol,dl{
white-space: normal;
&:hover{
text-decoration: underline;
& p{
& .markdown-body{
color: #466AFF;
}
}