We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d5f76b5 commit cce2f2eCopy full SHA for cce2f2e
1 file changed
src/components/map-projects/Concept.jsx
@@ -6,14 +6,15 @@ import Button from '@mui/material/Button'
6
import Chip from '@mui/material/Chip'
7
import isString from 'lodash/isString'
8
import map from 'lodash/map'
9
+import orderBy from 'lodash/orderBy'
10
11
import Retired from '../common/Retired'
12
import Score from './Score'
13
import MapButton from './MapButton'
14
import ConceptSummaryProperties from '../concepts/ConceptSummaryProperties'
15
16
const getBestSynonym = synonyms => {
- return synonyms
17
+ return orderBy(synonyms, match => match.length)
18
.map(text => {
19
const matches = [...text.matchAll(/<em>(.*?)<\/em>/g)];
20
const longestMatch = matches.reduce((a, b) => (b[1].length > a.length ? b[1] : a), "");
0 commit comments