// highlitingall but getting error at ist plural
// highlightContent(content, keywords) {
// console.log(content);
// const regexPattern = keywords
// .map(keyword => {
// const escapedKeyword = keyword.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&");
// return `\\b${escapedKeyword}(?:(?:'s|s\\b|'\\bs)\\b(?!\\s*[a-z]))?`;
// })
// .join('|');
// const regex = new RegExp(regexPattern, 'gi');
// const highlightedContent = content.replace(regex, match => `<span class="highlight">${match}</span>`);
// console.log(highlightedContent);
// return highlightedContent;
// },
// return `\\b${escapedKeyword}\\b`;
highlightContent(content, keywords) {
const regexPattern = keywords
.map(keyword => {
const escapedKeyword = keyword.replace(/[.*+\-?^${}()|[\]\\]/g, '\\$&');
return `\\b${escapedKeyword}(?:(?:'s|'\\bs)\\b(?!\\s*[a-z]))?`;
})
.join('|');
const regex = new RegExp(regexPattern, 'gi');
const highlightedContent = content.replace(regex, match => `<span class="highlight">${match}</span>`);
return highlightedContent;
},
// const isIdInArray = this.get_competitor_subscriptions.some(item => item.item === this.defaults.competitor_subscription_id);
ReplyDelete// if (!isIdInArray) {
// this.defaults.competitor_subscription_id="";
// }