Skip to content

Commit 88b33e7

Browse files
committed
fix: recommendation can write html data
1 parent 9407337 commit 88b33e7

File tree

3 files changed

+38
-3
lines changed

3 files changed

+38
-3
lines changed

src/components/volunteer/VolunteerProfile.module.css

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,23 @@
6969
}
7070

7171
.recommendation p {
72+
font-size: 14px;
73+
line-height: 1.7;
74+
color: #374151;
75+
margin: 0;
76+
text-align: left;
77+
text-indent: 2em;
78+
word-wrap: break-word;
79+
hyphens: auto;
80+
display: -webkit-box;
81+
-webkit-line-clamp: 7;
82+
-webkit-box-orient: vertical;
83+
overflow: hidden;
84+
text-overflow: ellipsis;
85+
max-height: calc(1.7em * 7);
86+
}
87+
88+
.recommendationContent div {
7289
font-size: 14px;
7390
line-height: 1.7;
7491
color: #374151;
@@ -126,6 +143,21 @@
126143
font-size: 13px;
127144
line-height: 1.6;
128145
margin: 0;
146+
text-indent: 2em;
147+
display: -webkit-box;
148+
-webkit-line-clamp: 8;
149+
-webkit-box-orient: vertical;
150+
overflow: hidden;
151+
text-overflow: ellipsis;
152+
max-height: calc(1.6em * 8);
153+
}
154+
155+
.recommendationContent div {
156+
font-size: 13px;
157+
line-height: 1.6;
158+
margin: 0;
159+
word-wrap: break-word;
160+
hyphens: auto;
129161
display: -webkit-box;
130162
-webkit-line-clamp: 8;
131163
-webkit-box-orient: vertical;
@@ -222,6 +254,7 @@
222254
color: #374151;
223255
margin: 0;
224256
text-align: left;
257+
text-indent: 2em;
225258
font-style: italic;
226259
word-wrap: break-word;
227260
hyphens: auto;

src/components/volunteer/VolunteerProfile.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default function VolunteerProfile({
4444

4545
<div className={styles.recommendation}>
4646
<div className={styles.recommendationContent}>
47-
<p>{recommendation}</p>
47+
<div dangerouslySetInnerHTML={{ __html: recommendation }} />
4848
</div>
4949
</div>
5050
</div>
@@ -83,7 +83,7 @@ export default function VolunteerProfile({
8383
<span className={styles.modalRecommendationTitle}>推荐语</span>
8484
</div>
8585
<div className={styles.modalRecommendationContent}>
86-
<p>{recommendation}</p>
86+
<div dangerouslySetInnerHTML={{ __html: recommendation }} />
8787
</div>
8888
</div>
8989
</div>

src/pages/community/cooperation/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ const cooperationStars2021 = [
4545
name: '何莹',
4646
nickname: '',
4747
avatar: '/img/cblecker.png',
48-
recommendation: '何(小)莹身为开源社社区合作组副组长,几年以来持续地投入社区合作,今年完美地组织以及主持了 “暑期2021之大咖说开源“,之后紧张地准备出国留学的同时,还积极地与开源社社区合作组小伙伴们推动 COSCon21 社区合作事宜,让 COSCon21的合作社区达到了创记录的 75 家以上,出国当天和到达留学地之后,仍不间断地联系社区合作伙伴们,坚持不懈的精神令人感动。我们亲昵地叫她 “流浪的开源小可爱“,因为她就是当仁不让的 “社区合作之星”。初次见面是何莹来给年会开源硬件论坛做翻译志愿者,之后便常常在开源社的各个社群都能看到她活跃的身影,为开源社的社区活跃和合作做了大量的贡献,她的热情的态度和细腻的笔触令开源社区增添了柔性的温度。初次见面是何莹来给年会开源硬件论坛做翻译志愿者,之后便常常在开源社的各个社群都能看到她活跃的身影,为开源社的社区活跃和合作做了大量的贡献,她的热情的态度和细腻的笔触令开源社区增添了柔性的温度。'
48+
recommendation: `<p>何(小)莹身为开源社社区合作组副组长,几年以来持续地投入社区合作,今年完美地组织以及主持了 “暑期2021之大咖说开源“,之后紧张地准备出国留学的同时,还积极地与开源社社区合作组小伙伴们推动 COSCon21 社区合作事宜,让 COSCon21的合作社区达到了创记录的 75 家以上,出国当天和到达留学地之后,仍不间断地联系社区合作伙伴们,坚持不懈的精神令人感动。我们亲昵地叫她 “流浪的开源小可爱“,因为她就是当仁不让的 “社区合作之星”。</p>
49+
<p>初次见面是何莹来给年会开源硬件论坛做翻译志愿者,之后便常常在开源社的各个社群都能看到她活跃的身影,为开源社的社区活跃和合作做了大量的贡献,她的热情的态度和细腻的笔触令开源社区增添了柔性的温度。初次见面是何莹来给年会开源硬件论坛做翻译志愿者,之后便常常在开源社的各个社群都能看到她活跃的身影,为开源社的社区活跃和合作做了大量的贡献,她的热情的态度和细腻的笔触令开源社区增添了柔性的温度。</p>
50+
`
4951
},
5052
{
5153
name: '范晶晶',

0 commit comments

Comments
 (0)