0707相关遗留issue

This commit is contained in:
黄心宇 2023-07-06 11:28:47 +08:00
parent cc61699c01
commit c2a5f2cac2
9 changed files with 13 additions and 8 deletions

View File

@ -5,6 +5,7 @@ import 'code-prettify';
import dompurify from 'dompurify';
import { getEmoji } from '../forge/Main/emoji';
import axios from 'axios';
import imgError from '../images/img-error.png'
import { renderToString } from 'katex'
@ -80,9 +81,10 @@ export default ({
const { type, expression } = math_expressions[capture];
return renderToString(_unescape(expression) || '', { displayMode: type === 'block', throwOnError: false, output: 'html' })
})
rs = rs.replace(/▁/g, "▁▁▁")
rs = dompurify.sanitize(rs.replace(/▁/g, "▁▁▁"))
rs = rs.replaceAll('<img ', `<img onerror="javascript:this.src='${ imgError }';"`)
resetMathExpressions()
return dompurify.sanitize(rs)
return rs
}, [str,issues]);
// #id

View File

@ -14,7 +14,7 @@ function DefaultImg({name,title}){
<img src={require(`../img/color${randomNumberInRange(1,4)}.png`).default} alt="" className="color" />
<span className="d_name">
<span>{name}</span>
<span>{title}</span>
{/* <span>{title}</span> */}
</span>
</div>
)

View File

@ -44,7 +44,7 @@ function Partner(props) {
return(
<div className="zone_part_item" key={ k1 }>
{ j.typeName && moreTypes && <span className="task-hide">{j.typeName}</span>}
<a key={ k1 } href={j.link} target="_blank"><img src={j.logo} alt=""/></a>
<a key={ k1 } href={ j.link ? j.link : 'javascript: void(0);' } target={ j.link ? "_blank" : "_self" }><img src={j.logo} alt=""/></a>
</div>
)
})

View File

@ -41,7 +41,7 @@ function PublicBanner(props){
data &&
<div className="zone_content">
<p className="main_t">{data.mainTitle}</p>
<p className="sub_t">{data.subTitle}</p>
<p className="sub_t" dangerouslySetInnerHTML={{ __html: data.subTitle }}></p>
</div>
}
<div className="bannerMenus">

View File

@ -77,7 +77,7 @@ function HeaderPage(props){
<div className="boxmain zone_infos">
<div className="zone_infos_desc">
{data.introductionTitle && <p className="z_name">{data.introductionTitle}</p>}
<p className="z_desc task-hide-2" style={{WebkitLineClamp:data.introductionTitle?"4":"7"}}>{data.introductionContent}</p>
<p className="z_desc task-hide-2" style={{WebkitLineClamp:data.introductionTitle?"4":"7"}} dangerouslySetInnerHTML={{ __html: data.introductionContent }} ></p>
</div>
{
data.introductionImage &&

View File

@ -129,7 +129,7 @@ function HeaderPage(props){
<div className="boxmain zone_infos mb30">
<div className="zone_infos_desc">
<p className="z_name">{data.introductionTitle}</p>
<p className="z_desc task-hide-2">{data.introductionContent}</p>
<p className="z_desc task-hide-2" dangerouslySetInnerHTML={{ __html: data.introductionContent }} ></p>
</div>
{
data.introductionImage &&

View File

@ -50,6 +50,7 @@
line-height:40px;
color:rgba(225,225,225,0.9);
font-size:16px;
white-space: pre-wrap;
}
}
.bannerMenus{
@ -692,6 +693,7 @@
line-height:32px;
word-break: break-all;
-webkit-line-clamp: 4;
white-space: pre-wrap;
}
}
}
@ -1129,7 +1131,7 @@
&>div{
overflow: hidden;
height: 100%;
width: 100vw;
// width: 100vw;
position: relative;
background-repeat: no-repeat;
background-size: 100% 100%;

View File

@ -29,6 +29,7 @@
line-height:32px;
word-break: break-all;
-webkit-line-clamp: 4;
white-space: pre-wrap;
}
}
}

BIN
src/images/img-error.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB