1
텍스트 영역에서 카라기 리턴을 파싱하는 작은 문제에 봉착했습니다.변환 캐리 지가 br 태그로 돌아 가기
JQuery와 코드가 작동하고 모든 작업을 나던 Internet Explorer에서
<big>Heading</big><br>Test Line 1<br>Test Line 2<br>Test Line 3
로 출력을 제공 파이어 폭스에서
$.fn.escapeHtml = function() {
this.each(function() {
$(this).html(
$(this).html()
.replace(/"/g,""")
.replace(/&/g,'&')
.replace(/</g,'<')
.replace(/>/g,'>')
.replace(/'/g,''')
// For converting carrage return (enter key) to br
.replace(/(\r\n|\r|\n)/g, '< br >')
.replace(/183/g,'·')
);
});
return $(this);
}
})(jQuery);
... 어떻게 IE에서이 문제를 해결 않습니다. ,
.replace(/(\n\n|\r|\n)/g, '< br >')
참고 또한 텍스트 영역에서 모두 :
.replace(/(\r\n|\r|\n)/g, '< br >')
으로 나의들이 의도 출력
- (.. 여전히 IE7에서 작동하지 않습니다. – Sullan