Skip to content

Commit cce2f2e

Browse files
committed
OpenConceptLab/ocl_issues#2299 | updated highlighter for synonym
1 parent d5f76b5 commit cce2f2e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/components/map-projects/Concept.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ import Button from '@mui/material/Button'
66
import Chip from '@mui/material/Chip'
77
import isString from 'lodash/isString'
88
import map from 'lodash/map'
9+
import orderBy from 'lodash/orderBy'
910

1011
import Retired from '../common/Retired'
1112
import Score from './Score'
1213
import MapButton from './MapButton'
1314
import ConceptSummaryProperties from '../concepts/ConceptSummaryProperties'
1415

1516
const getBestSynonym = synonyms => {
16-
return synonyms
17+
return orderBy(synonyms, match => match.length)
1718
.map(text => {
1819
const matches = [...text.matchAll(/<em>(.*?)<\/em>/g)];
1920
const longestMatch = matches.reduce((a, b) => (b[1].length > a.length ? b[1] : a), "");

0 commit comments

Comments
 (0)