以下のJSONを正常に取得しましたが、これらの厄介な正規表現\ r \ n \ r\nを<br/>
'に変換する際に問題が発生します。私は現在次のコードを使用していますが、それはほんの少ししかエスケープしていません。\ r \ n、\ r \ n \ r\nを含む正規表現のすべてのインスタンスを置き換えることを検討しています。以前に使用したコードは次のとおりです。
$('<ul class="job-listing"><li class="job-position"><h2>'+post.m_positionName+'</h2></li><li class="job-description">'+post.m_description.replace('\r\n','<br />')+'</li></ul>').appendTo('body');
JSONは次のとおりです。
[
{
"m_id": 473644,
"m_positionName": "Application Monitoring Software Engineer",
"m_positionLocations": [
{}
],
"m_active": true,
"m_description": "Job Responsibilities:\r\n\r\n-Create world class application monitoring tools and dashboards for our health care applications\r\n\r\n-Develop business rules to pro actively identify and re-mediate system-level issues before they occur.\r\n\r\n-Create business intelligence reports for internal and external use as a supplement to software products.\r\n\r\n\r\n\r\nJob Requirements:\r\n\r\n-BS or MS Degree in computer science or any engineering discipline.\r\n-4+ years of experience with Java (or other object-oriented programming language).\r\n-Experience in SQL, Struts, Hibernate, Spring, Eclipse, JSP, JavaScript.\r\n-Highly motivated and self-driven personality.\r\n-Excellent interpersonal and leadership skills.\r\n-A vision for the future and a desire to make a difference.\r\n-Experience with Maven, Tomcat, PostgreSql, Jasper Reports,",
"m_postedDate": "Jun 29, 2012 9:17:19 AM",
"m_closingDate": "Jun 29, 2013 12:00:00 AM"
}