Wrap Arabic

by SpacePineapple

HTML

<textarea id="wordpaste" cols="200" rows="10">
</textarea>
<input type="button" id="btnGo" value="decode"/>

JavaScript

arregex = /[\u0600-\u06ff\u0750-\u077f\ufb50-\ufc3f\ufe70-\ufefc]+/g

document.getElementById("btnGo").onclick = function (){
    document.getElementById("wordpaste").value = document.getElementById("wordpaste").value.replace(/\n/g, "<br/>").replace(arregex, function(all){ return "<span style=\"font-size: 32px; font-family: 'traditional arabic';\">" + all + "</span>"});
}