striphtml problem Options
chris
Posted: Wednesday, February 06, 2008 3:02:02 PM
Rank: Devotee

Joined: 4/12/2007
Posts: 93
Location: Amsterdam
Hi all!
I use somewhere the striphtml function but I've got a problem with it.........when it stripes for example this part: <p><strong>De ligging</strong></p><p>Finca Dulce Vida it end up with: De liggingFinca Dulce Vida .
As you can imagine this is not what I would like to achieve........It looks like when there is a 'De ligging</strong></p><p>Finca' end p and begin p it's going wrong, I tested it to change it like <p><strong>De ligging </strong></p><p>Finca Dulce Vida (notice the space behind ligging) and then it works ok. Is it normal and if so can I change the striphtml behaviour for this??
thanks in advance,
Chris
mortenbock
Posted: Wednesday, February 06, 2008 4:35:01 PM

Rank: Addict

Joined: 7/19/2006
Posts: 790
Location: Århus, Denmark
Well, i guess that prior to running the striphtml on your string, you could run a replace where you replace '</p>' with ' </p>' (notice the space).

That would be a very simple solution to that problem. :-)

Morten Bock - Level 2 certified - MVP 2008/2009 - My danish blog with a few english posts

chris
Posted: Thursday, February 07, 2008 8:40:50 AM
Rank: Devotee

Joined: 4/12/2007
Posts: 93
Location: Amsterdam
Thanks for replying morton! I already took the striphtml away and indeed it work well when I used the replace function to get away the <p> and </p>. The problem I have with this way is that I have to replace ALL html with the replace function and that made the site slower because the large replace function on it..........
I'm a C#/.NET noob myself but my colleque's (?) are bether with it. Is it possible to change the source of Umbraco to make the striphtml to do what I want......??
greetings,
Chris
mortenbock
Posted: Thursday, February 07, 2008 9:02:58 AM

Rank: Addict

Joined: 7/19/2006
Posts: 790
Location: Århus, Denmark
Actually what I was aiming at was just to prepare the text for the striphtml method. So first you do a simple replace of the ending </p> tag, where you add a space. And then you run the striphtml function on your new string, which will then take care of the tags them selves.

Morten Bock - Level 2 certified - MVP 2008/2009 - My danish blog with a few english posts

Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.