Gossamer Forum
Home : Products : Gossamer Links : Discussions :

overriding compress

Quote Reply
overriding compress
Hi there,

Does anyone have any suggestions how I might be able to override the compress feature at any given moment.

I have 2 needs on this.
1. Javascript gets compressed and doesn't work with compress on.
2. In some situations (particularly emails) I'd like to be able to use multiple blanks spaces and can't use the <pre> </pre> tags as they actually print out.

I've tried embedding the <pre> tag inside the <%-- gossamer tag --%> but it doesn't work, nor does it work inside of the hidden field tags <!-- html --> because they print out in emails.

I imagine some extra coding would need to go in GT::Template::_compress

Perhaps a tag like <%pre%><%/pre%> could be reserved for that?

Any suggestions on how that could be implemented?

peace.
Quote Reply
Re: [klangan] overriding compress In reply to
I think, no override is needed for compress option, but should be corrected the bugs in the html compression feature.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [webmaster33] overriding compress In reply to
>>
but should be corrected the bugs in the html compression feature.
<<

Alex asked you to provide an example to prove it was a bug, so you can't call it a bug until you prove it Angelic
Quote Reply
Re: [Paul] overriding compress In reply to
Paul, you are right. I just based my opinion on what Klagan wrote.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [Paul] overriding compress In reply to
Well,

The compressing of javascript could be a bug. Just enter some javascript into a file with compress on and when the page get's built, javascript error is often the result.

Mostly though, I need a way to override the compression so I can use compression AND multiple spaces in my emails.

I just did this and it seems to work fine.

I created a tag called <space></space> whatever is between the two tags won't be compressedSmile

in GT::Template::_compress
changed:
if ($$text =~ /<(?:pre|textarea)/i) {
to
if ($$text =~ /<(?:pre|textarea|space)/i) {

changed:
$$text =~ s(\G(.*?)(<(?:pre|textarea).*?</(?:pre|textarea)>))(
to:
$$text =~ s(\G(.*?)(<(?:pre|textarea|space).*?</(?:pre|textarea|space)>))(

and after:
$html . $pre;
)iesg;
added:
$$text =~ s/<(space|\/space)>//gi;

Does there appear to be anything wrong with the coding? Does someone have a better tag name than <space></space> (HTML reserves <spacer> - I don't use it, will it be affected? Is there a better way of doing this?



Thanks for listening.

peace.
Quote Reply
Re: [klangan] overriding compress In reply to
For the JS problem, use .js files.

BTW: To maintain ASCII special characters OR HTML tags in your template files, like for spacing, you could add a global called something like pre.
========================================
Buh Bye!

Cheers,
Me

Last edited by:

Stealth: May 16, 2002, 9:57 AM