We have created a new DCR that generates JSON. However the text fields in TinyMCE are adding line breaks to <li> tags and breaking the JSON format.
<ul>
<li>Now the talk is that by doing less, the Fed could trigger a market collapse.</li>
<li>The US economy’s forward momentum should also continue to support the stock market.</li>
</ul>
I've tried using the following JS function but it's not removing the line breaks. Any suggestions? Thanks.
function removeLineBreaks (item) {
var description_f = item.getName();
var description_event = IWDatacapture.getItem(description_f);
var description_val = description_event.getValue();
if((description_val != null) || (description_val != "")) {
var myNewString = description_val.replace(/(\r\n|\n|\r)/gm,"");
//window.alert(myNewString);
description_event.setValue(myNewString);
}
}