We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e17d37e commit 8b611b5Copy full SHA for 8b611b5
admin/src/components/CMEditView/utils/index.js
@@ -118,9 +118,8 @@ const buildKeywordDensityObject = (keywords, words) => {
118
keywords.map((keyword) => {
119
if (!_.isEmpty(keyword)) {
120
const trimmedKeyword = keyword.trim();
121
- const count = words.filter((word) =>
122
- word.includes(trimmedKeyword)
123
- ).length;
+ const exp = new RegExp(trimmedKeyword, 'g');
+ const count = (words.join(' ').match(exp) || []).length;
124
if (keywordsDensity[trimmedKeyword] === undefined) {
125
keywordsDensity[trimmedKeyword] = { count };
126
} else {
0 commit comments