0
[1] This is an example of what I would like to do, but I don’t know how to apply it to my case.
I would like to wrap items of the same type in a ol
his.
Original text:
<li>
<p>a) texto longo;</p>
</li>
<li>
<p>b) texto longo;</p>
</li>
<li>
<p>I - texto longo;</p>
</li>
<li>
<p>a) texto longo;</p>
</li>
<li>
<p>b) texto longo;</p>
</li>
<li>
<p>c) texto longo;</p>
</li>
I would like you to return this value:
<ol>
<li>
<p>a) texto longo;</p>
</li>
<li>
<p>b) texto longo;</p>
</li>
</ol>
<li>
<p>b) texto longo;</p>
</li>
<ol>
<li>
<p>a) texto longo;</p>
</li>
<li>
<p>b) texto longo;</p>
</li>
<li>
<p>c) texto longo;</p>
</li>
</ol>
[1] = http://board.phpbuilder.com/showthread.php?10368819-Turning-a-array-into-HTML-nested-list
It is not clear what you want. Also, note that the resulting HTML displayed in your question is invalid.
– Vinícius Gobbo A. de Oliveira
I know the ol should stay inside the li to nestOls, but I tried to summarize to not stay long.
– Alê Moraes
I have a list that has items that start with Roman numerals and others that start with a), b), c) and so on, I would like to wrap items of the same type in an ol from it
– Alê Moraes
I edited your question including the comment above (and some other details), but it still doesn’t seem to be very clear what you want. In the first example is
a)
,b)
,I)
,a)
,b)
,c)
, while in the second is (the result you want)a)
,b)
,b)
,a)
,b)
,c)
. The right way out wouldn’t bea)
,b)
,a)
,b)
,c)
(only excluding theI)
?– gustavox
There’s a li left over there
</ol>
<li>
 <p>b) texto longo;</p>
</li>
<ol>
– Guilherme Nascimento
That read is from item "I"
– Alê Moraes