[JavaScript] Wrap Pāli Words in Span Element
Wrap Pāli words in span element via regular expression and JavaScript.
function markInSpan(htmlString) {
return string.replace(/[AaBbCcDdEeGgHhIiJjKkLlMmNnOoPpRrSsTtUuVvYyĀāĪīŪūṀṁṂṃŊŋṆṇṄṅÑñṬṭḌḍḶḷ]+/g, '<span>$&</span>');
}
References:
[1] | javascript string replace |