I have a string I am getting back from an API that looks like this:
[{"lat":"39.142971","lng":"-77.215924","hours":"Monday - Wednesday: 11:30am to 11:00pm\r\nThursday: 11:00am to 11:00pm\r\nFriday-Saturday: 11:00am to 12:00am\r\nSunday: 11:30am to 10:00pm","phone":"3019634847","name":"DFH Alehouse, Gaithersburg"}]
When I parse the hours I am running it through this to make new lines when I display it on a web page:
hours = hours.replace(/(?:\\[rn])+/g, "<br/>");
But when it displays, it is not inserting the line breaks. The odd thing to me is that when I store my own data in a my database and I type it with \n the above code works. But now when I am taking it from the api.