Skip to content

Commit

Permalink
Merge pull request #36 from Sunbird-ALL/all-1.1-prod-hotfix
Browse files Browse the repository at this point in the history
All 1.1 prod hotfix merge to prod branch
  • Loading branch information
sudeeppr1998 authored Aug 21, 2024
2 parents f80a4c6 + eeb3e8f commit 96b5939
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/services/content.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -782,9 +782,14 @@ export class contentService {
const text: string = contentDataEle.contentSourceData[0]['text'].trim();
const matchRes = text.match(regexMatchBegin);
if (matchRes != null) {
const matchedChar = text.match(
new RegExp(`(${unicodeArray.join('|')})`, 'gu'),
);
let matchedChar = [];

if (unicodeArray.length != 0) {
matchedChar = text.match(
new RegExp(`(${unicodeArray.join('|')})`, 'gu'),
);
}

wordsArr.push({ ...contentDataEle, matchedChar: matchedChar });
} else {
wordsArr.push({ ...contentDataEle, matchedChar: [] });
Expand Down

0 comments on commit 96b5939

Please sign in to comment.