I have a text string in arabic and i want to make some words Bold and add icons before the word
the method I am using for this for english text is
var wordsToBold = ["Properties", "How To Use"];
function makeBold(input, wordsToBold) {
return input.replace(new RegExp('(\b)(' + wordsToBold.join('|') + ')(\b)', 'ig'),
'<br><br><i class="fas fa-ellipsis-h fa-xs mr-2"></i>$1<b>$2</b>$3');
}
When i use this method with arabic words it does not working
var wordsToBold = ["???????", "????? ?????????"];
A text for testing:
??????? ???? ???????: ????? ?????? ????? ??? ???? ,??????????? ??????
?????? ??????,??? ?? ??????? ??????
??????????????? ?????? ?? ????? ????? ??????? . ????? ?????????: ??
???? ?? ????? ??????,????? ???????
????? ?????? ??????? ???????
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…