3

[JavaScript] Wrap Pāli Words in Span Element

 2 years ago
source link: http://siongui.github.io/2016/04/02/javascript-wrap-pali-words-in-span-element/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

[JavaScript] Wrap Pāli Words in Span Element

April 02, 2016

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


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK