JSFiddle - React, Tailwind, and code Playground

by Nick Craver

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/dot-luv/jquery-ui.css">
     12

CSS

span { border: solid 1px red; }

JavaScript

$("p, div, html, body").each(function(){
    $(this).contents().filter(function() {
        var regExText = /(\w|\d|,|;|&)/;                                           
        if (this.nodeType == 3 && regExText.test(this.nodeValue)) {
            $(this).wrap('<span></span>');
            }
      });
});