How to add line breaks into HTML using Javascript -


i'm working on website uses datafeed. within datafeed (that comes in via csv file) there paragraph of text. client entering text in bullet point format , displayed such. example:

  • first point here... * second point here... * third point here...

(the client using asterix points, it's text editor here converting first bullet point)

does know way i'm able insert line breaks before first asterix appears list? maybe little javascript?

ideally list appear this:

  • first point here...
  • second point here...
  • third point here...

thanks in advance,

tom

ok i'm guessing here mixture of question , comments looks if rendered html of list this:

<ul>     <li>first point here... * second point here... * third point here...</li> </ul> 

from comment, looks if using jquery can this:

$(function() {     $('li').each(function() {         var listitem = $(this),             text =  listitem.text().replace(/\*/g, '<li>');          listitem.html(text);     }); }); 

example


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -