I have paragraph text like:
"2 lb thawed chicken breasts1/2 cup jarred red salsa try and choose a basic 2 carbs/2 tbs option- we love the double roasted from Trader Joes5 cloves garlic minced I use the frozen dorot cubes every time!1 tbs liquid smoke sold near bottled barbecue sauce at any normal store1-2 tbs chipotle peppers in adobo sauce."
That I would like to look like this
- 2 lb thawed chicken breasts
- 1/2 cup jarred red salsa try and choose a basic 2 carbs/2 tbs option- we love the double roasted from Trader Joes
- 5 cloves garlic minced I use the frozen dorot cubes every time!
- 1-2 tbs chipotle peppers in adobo sauce.
I understand it might be impossible to distringuish between the serving amounts and just random numbers in the text but I can go through and correct those instances.
I have tried the following:
function makeList(text){
let textString = new String(text)
let newText = textString.split(/(?=\d+(\/\d+|\.\d+))/g)
return newText
}
but it doesn't seem to split the paragraph correctly.
Thank you for the help!