I am in a weird scenerio where I need to show the content in multiple columns. I am using css3 column-cont and jquery plugin columnizer for older versions of IE. The problem is that I do not have complete control over the data as it is served by an external webservice. In most cases the content is wrapped in multiple paragraph tabs
Content#1
<p><strong>Heading</strong><br>This is a content</p>
<p><strong>Heading</strong><br>This is a content</p>
But In few cases the data is not wrapped in <p>
tag and looks like below:
Content#2
<strong>Day 1: xyz </strong><br>
lorem lipsum <br> <br>
<strong>Dag 2: lorem lipsum</strong><br>
Morgonflyg till Arequipa i södra Peru.
<br> <br>
The real problem is jquery columnizer
plugin hangs up the browser with this markup when it is asked to columnize such content.
Now I want to transform Content#2
to Content#1
with the help of regular expression,ie wrap the contents into sensible paragraphs. I hope I have made myself clear
I am using PHP.
Thank you in advance!
Flyg till Lima med korti Amsterdan. Ankomst på kvällen till Lima. [Måltider på flyget]
Dag 2: Världsarvstaden Lima och middag på piren vid Stilla havet
Upptäcktsfärd till fots genom
Dag 3: Arequipa och Santa Catalinaklostret
Eftermiddagen fri för egna strövtåg i de vackra omgivningarna. [F]
Dag 4: Genom Colcadalen till Chivay
Dagen
Dag 5: Längs högplatån Altiplano till Puno vid Titicacasjön.
Dagen inleds med be` – Dipesh KC Sep 26 '13 at 11:23
content
this pattern gets repeated – Dipesh KC Sep 26 '13 at 11:25