Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Markup tags appearing in daily subscriber emails

Quote Reply
Markup tags appearing in daily subscriber emails
A user posted a message and colored some of her text. When the daily archive (digest) email arrived in our mailboxes, the markup tags for the colors were spread throughout the text - looking very messy.

I also noticed markup tags in a user's email address in his signiture.

Is there any way to stop this from occurring? The vast majority of our user base only see the daily subscriber emails, so to them, this appears as sloppy work on our part.

Any help is appreciated.

Thanks,

Peter Budnick
forum.ergoweb.com

Last edited by:

budnick: Jun 14, 2004, 9:06 AM
Quote Reply
Re: [budnick] Markup tags appearing in daily subscriber emails In reply to
I haven't noticed color tags in the subscription emails, but I don't use much color. But I did notice a couple of other HTML tags in signatures like <br> and <hr>, which I agree are a little annoying. In addition, image tags (smiles in this case) list the source link like: '' instead of killing them all together.

Dave
Quote Reply
Re: [budnick] Markup tags appearing in daily subscriber emails In reply to
You'll need a global variable to strip out the HTML and GForum tags. This one isn't perfect, but will get you started:

Code:
sub {
my $post_message = shift;

$post_message=~ s/^\s*//; # leading spaces
$post_message=~ s/\s*$//; # trailing spaces
$post_message=~ s/\s+/ /g; # multiple spaces
#
# Strip HTML tags
#
$post_message=~ s(<[^>]*>)()g;
$post_message=~ s(\[url.*\])()g;
$post_message=~ s(\[\/url\])()g;
$post_message=~ s(\[signature\])()g;
$post_message=~ s(\[size*\])()g;
$post_message=~ s(\[inline.*\])()g;
#
# Decode HTML encoded characters
#
$post_message=~ s(\&lt;) (<)g;
$post_message=~ s(\&gt;) (>)g;
$post_message=~ s(\&amp;) (&)g;

return substr($post_message,0,200);
}

Then, in the appropriate template, replace $post_message with

Code:
<%html_strip($post_message)%>

where html_strip is whatever you called the global. In your case, you probably want to add a line for the color tags.