here’s the link where I’m trying this:
http://jsbin.com/ajirim/2/edit#source
the js code:
$(function(){
$('button').click(dao);
});
function dao() {
var x = $('textarea').val();
if(x.substring(0,4) == ' ')
{
x = x.replace('\n ','\n').substr(4);
}
else
{
x = ' '+ x.replace('\n', '\n ');
}
$('textarea').val(x);
}
You’re missing the
gflag: