JSFiddle - React, Tailwind, and code Playground
by tim spear
HTML
Paste your text here:
<p>
<textarea id="input"></textarea>
</p><p>
Output here
(with codepoints numbers if >128):
<div id="output"> output</div>
</p>
JavaScript
$("#input").on('input',function() {
input = $("#input").val();
ch = [...input]
len = ch.length
console.log(len);
out = ""
for (i=1;i<len;i++){
no = ch[i].codePointAt(0)
out = out + ch[i] ;
if (no==10)(out += "<br>")
if (no>128 ){out += "["+no+"]"}
}
$("#output").html(out);
});