[ic] Strip HTML and IC tags

Ron Phipps interchange-users@interchange.redhat.com
Fri Feb 22 19:20:00 2002


> From: interchange-users-admin@interchange.redhat.com
[mailto:interchange-
> users-admin@interchange.redhat.com] On Behalf Of cfm@maine.com
> 
> On Sat, Feb 23, 2002 at 12:09:41AM +0100, Joachim Leidinger wrote:
> > Ron Phipps wrote:
> > >
> > > How should I go about stripping all HTML and IC tags from a
variable
> or
> > > field?  A search of the filter tag only turned up text2html which
will
> > > convert line breaks to <BR> for display on an html page.  I'd like
to
> go
> > > the other way, but remove all ITL and HTML tags.  I gather that it
> would
> > > take a complex set of regexes to do this from my search of google.
Is
> > > there a way to do this that is included with IC or should I look
at
> > > writing a usertag of my own?
> >
> > Maybe that or you can define your own filter, which can used like
the
> > other IC filter.
> 
> You can write a filter.  PITA.  We've had to do that in some
> cases where we get the data marked up in the first place, say in
> book descriptions that come to us word processed.  I think that
> is a flawed process conceptually.

The filter was easy to write and should work for our situation.

> It's WAY better to pull the data **before** it gets marked up if that
> is at all possible.  There is no reason you should have to be
> stripping IC tags.
> 

I'm trying to produce some functionality for our client without
completely hacking the option code.  We'd like to upgrade to the new
option code in 4.10 or 5.0 when it's ready without having to port our
hacks.  The small changes we have made will be given back to IC once I
get a chance to diff them and test in more cases.

They wanted the ability to have a radio button with an option be linked
to an existing product.  So if they click on the option it shows the
product that is acting as an option to the master product. 

We found that if we generated the options as type matrix, separate
widgets then put in the label with html and itl to link to the product
that it would show up on the display pages as they wanted.  Then when we
used the item-options tag with report=1 the itl and html was still
showing since it was stored in the actual label.  A simple filter
removed the itl and html code and a plain text report resulted.  We
found that it was easier for both coding and future IC upgrades to put
the html and itl right in the label instead of adding another field to
the option database, entering the sku, then editing build_accessory_box
to generate a label with the label linked to the sku.

BTW if you have not played with the options in 4.8.x check them out.
I'm way impressed with what has been included and look forward to the
next few revisions as modular and matrix options are refined.

Thanks for the suggestions,
-Ron