Mit dem Code findest Du raus, ob und wo in dem Text mehr als limit Zeilenumbrüche am Stück sind:
PHP-Code:
<script type='text/javascript'>
function asd() {
var limit=2;
var text=document.getElementById('txt').value;
var lb, res, temp='', i;
if (text.search(/rn/)>0) {
lb="\r\n";
}
else if (text.search(/r/)>0) {
lb="\r";
}
else {
lb="\n";
}
for (i=0; i<=limit; i++) {
temp+=lb;
}
lb=temp;
res = text.search(lb);
document.getElementById('out').value = res;
}
setInterval('asd()', 10);
</script>
<textarea id='txt' cols='50' rows='20'>Das ist Text
Mit Umbrüchen</textarea>
<textarea id='out'></textarea>
Probier's einfach mal aus, vielleicht hilft's ja.
PS: Ach ja, nur im Firefox 1.07 getestet, sollte aber überall klappen.