Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

replace all br tags within node with paragraph opening and closing tags

//My suggestion will be to split the text by <br>:

var lines = content.split("<br>");

//Now you can wrap each line in a <div>:

var newContent = "";
for(var i=0,l=lines.length;i<l;i++){
     newContent += "<div>"+lines[i]+"</div>";

}
 
PREVIOUS NEXT
Tagged: #replace #br #tags #node #paragraph #opening #closing #tags
ADD COMMENT
Topic
Name
2+8 =