@@ -167,17 +167,6 @@ const SearchResultContainer = styled.div`
167
167
color: #004187;
168
168
}
169
169
170
- .descLink {
171
- margin: 0 3px 0 3px;
172
- padding: 1px 5px 1px 5px;
173
- border: 1px solid #9EC1DB;
174
- border-radius: 5px;
175
- font-weight: bold;
176
- background-color: #DFEEF9;
177
- color: #004187;
178
- line-height: 2.5em;
179
- }
180
-
181
170
a[target="_blank"] {
182
171
color: #004187;
183
172
background: url(${ externalIcon } ) right center no-repeat #DFEEF9;
@@ -608,43 +597,6 @@ const SearchResult = ({
608
597
} else {
609
598
desc = desc . replace ( / < (? ! [ b / ] ) / g, "<" ) ;
610
599
}
611
- const arr = desc . split ( "http" ) ;
612
- let descArr = [ ] ;
613
- if ( arr . length > 1 ) {
614
- if ( arr [ 0 ] . endsWith ( "<b>" ) ) {
615
- descArr . push ( arr [ 0 ] . substring ( 0 , arr [ 0 ] . length - 3 ) ) ;
616
- } else {
617
- descArr . push ( arr [ 0 ] ) ;
618
- }
619
- for ( let i = 1 ; i < arr . length ; i += 1 ) {
620
- const urlArr = arr [ i ] . split ( " " ) ;
621
- const url = urlArr [ 0 ] . replace ( "</b>" , "" ) ;
622
- const urlLastChar = url [ url . length - 1 ] ;
623
- if ( ",;.()<>{}" . includes ( urlLastChar ) ) {
624
- const newUrl = "http" . concat ( url . substring ( 0 , url . length - 1 ) ) ;
625
- descArr . push ( newUrl ) ;
626
- const restText = arr [ i ] . split ( url . substring ( 0 , url . length - 1 ) ) [ 1 ] ;
627
- if ( restText . endsWith ( "<b>" ) ) {
628
- descArr . push ( restText . substring ( 0 , restText . length - 3 ) ) ;
629
- } else {
630
- descArr . push ( restText ) ;
631
- }
632
- } else {
633
- const newUrl = "http" . concat ( url ) ;
634
- descArr . push ( newUrl ) ;
635
- if ( urlArr . length !== 1 ) {
636
- const restText = arr [ i ] . split ( url ) [ 1 ] ;
637
- if ( restText . endsWith ( "<b>" ) ) {
638
- descArr . push ( restText . substring ( 0 , restText . length - 3 ) ) ;
639
- } else {
640
- descArr . push ( restText ) ;
641
- }
642
- }
643
- }
644
- }
645
- } else {
646
- descArr = arr ;
647
- }
648
600
const otherMatches = [ ] ;
649
601
if ( rst . highlight ) {
650
602
Object . keys ( rst . highlight ) . forEach ( ( hl ) => {
@@ -773,20 +725,7 @@ const SearchResult = ({
773
725
< div className = "col" >
774
726
< label > Description:</ label >
775
727
< span className = "textSpan" >
776
- {
777
- descArr . map ( ( item , desidx ) => {
778
- const deskey = `des_${ desidx } ` ;
779
- return (
780
- item . includes ( "http" )
781
- ? (
782
- < span key = { deskey } className = "descLink" >
783
- < a href = { item } target = "_blank" rel = "noreferrer noopener" > { item } </ a >
784
- </ span >
785
- )
786
- : < span key = { deskey } > { ReactHtmlParser ( item ) } </ span >
787
- ) ;
788
- } )
789
- }
728
+ { ReactHtmlParser ( desc ) }
790
729
</ span >
791
730
</ div >
792
731
</ div >
@@ -905,24 +844,6 @@ const SearchResult = ({
905
844
</ span >
906
845
) ;
907
846
}
908
- if ( am . name === "GEO Study Identifier" ) {
909
- const geoId = m . replace ( / < b > / g, "" ) . replace ( / < \/ b > / g, "" ) ;
910
- const geoLink = '' . concat ( 'https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=' , geoId ) ;
911
- return (
912
- < span className = "itemSpan" >
913
- < a href = { geoLink } target = "_blank" rel = "noreferrer noopener" > { geoId } </ a >
914
- </ span >
915
- ) ;
916
- }
917
- if ( am . name === "dbGaP Study Identifier" ) {
918
- const dbId = m . replace ( / < b > / g, "" ) . replace ( / < \/ b > / g, "" ) ;
919
- const dbLink = '' . concat ( 'https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=' , dbId ) ;
920
- return (
921
- < span className = "itemSpan" >
922
- < a href = { dbLink } target = "_blank" rel = "noreferrer noopener" > { dbId } </ a >
923
- </ span >
924
- ) ;
925
- }
926
847
return (
927
848
< span className = "itemSpan additionalItemSpan" > { ReactHtmlParser ( m ) } </ span >
928
849
) ;
0 commit comments