File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed
Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -87,15 +87,26 @@ function ProfilePreview(props: {
8787 const bio = profile . bio as JSONContent ;
8888
8989 if ( bio && bio . content ) {
90- bio . content = bio . content ?. map ( c => {
91- if ( c . type === 'heading' || c . type === 'list' ) {
92- return {
90+ const newBio = [ ]
91+ let i = 0
92+ for ( const c of bio . content ) {
93+ if ( ( c ?. content ?. length || 0 ) == 0 ) continue
94+ if ( c . type === 'paragraph' ) {
95+ newBio . push ( c )
96+ } else if ( [ 'heading' ] . includes ( c . type ?? '' ) ) {
97+ newBio . push ( {
9398 type : 'paragraph' ,
9499 content : c . content
95- }
100+ } )
101+ } else if ( c . type === 'image' ) {
102+ continue
103+ } else {
104+ newBio . push ( c )
96105 }
97- return c
98- } )
106+ i += 1
107+ if ( i >= 5 ) break
108+ }
109+ bio . content = newBio
99110 }
100111
101112 return (
You can’t perform that action at this time.
0 commit comments