Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: Embperl

Stop embperl from messing with my code

 

 

ModPerl embperl RSS feed   Index | Next | Previous | View Threaded


embperl at thefreecat

Jul 24, 2008, 1:42 AM

Post #1 of 5 (3393 views)
Permalink
Stop embperl from messing with my code

Hello,

I have really strange behaviours in my generated pages and I suspect
embperl to be "modifying" my html. I'd like to prevent this.

The case is this (I use Embperl Object) :

base.epl:
<div id="upperband">
<a href="/" class="noborder"> [- Execute('upperband.epl'); -]</a>
</div>

upperband.epl:
<img src="/img/upperband_home.png" class="noborder" />

subdir/upperband.epl:
<img src="/img/upperband_subdir.png" class="noborder" />


As you see, I want a different image in the upper band depending on where the
user is.

The problem lies in base.epl : immediately after the <a href="/" class="noborder">
and before the [- Execute... -]

* If I leave the space, I get... a (vertical) space after the block.
* If I remove the space, the generated code is this :

<a href="/" class="noborder"<img src="/img/upperband_home.png" class="noborder" />
></a>

So my "<a ...>" tag is broken and I see the ">" character.


Also, I take the care of having only one space between 'href="/"' and 'class=...'
and I'd like embperl not to add useless spaces. On a big page with lots of tags
it becomes significant.


Is there a way to disable embperl's reinterpretation of the HTML code ? I never
use the auto-table-like features.

Thanks,

--
Jean-Christophe Boggio -o)
embperl [at] thefreecat /\\
Independant Consultant and Developer _\_V

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe [at] perl
For additional commands, e-mail: embperl-help [at] perl


neil at nilspace

Jul 24, 2008, 7:52 AM

Post #2 of 5 (3209 views)
Permalink
Re: Stop embperl from messing with my code [In reply to]

Jean-Christophe Boggio wrote:
> Hello,
>
> I have really strange behaviours in my generated pages and I suspect
> embperl to be "modifying" my html. I'd like to prevent this.
>
> The case is this (I use Embperl Object) :
>
> base.epl:
> <div id="upperband">
> <a href="/" class="noborder"> [- Execute('upperband.epl'); -]</a>
> </div>
>
> upperband.epl:
> <img src="/img/upperband_home.png" class="noborder" />
>
> subdir/upperband.epl:
> <img src="/img/upperband_subdir.png" class="noborder" />
>
>
> As you see, I want a different image in the upper band depending on
> where the
> user is.
>
> The problem lies in base.epl : immediately after the <a href="/"
> class="noborder">
> and before the [- Execute... -]
>
> * If I leave the space, I get... a (vertical) space after the block.
> * If I remove the space, the generated code is this :
>
> <a href="/" class="noborder"<img src="/img/upperband_home.png"
> class="noborder" />
> ></a>
>
> So my "<a ...>" tag is broken and I see the ">" character.
>
>
> Also, I take the care of having only one space between 'href="/"' and
> 'class=...'
> and I'd like embperl not to add useless spaces. On a big page with lots
> of tags
> it becomes significant.
>
>
> Is there a way to disable embperl's reinterpretation of the HTML code ?
> I never
> use the auto-table-like features.
>
> Thanks,
>

This does look like an Embperl bug, based on your description of what
changes in the output when you change your code. However, there is a way
to modify what Embperl does in terms of processing HTML tags - assuming
you are compiling Embperl from source. I wanted to keep the forms
processing (i.e. have Embperl still process input tags) but didn't want
it messing with TABLE and TR etc, which it was barfing on because of the
nesting being messed up by conditional blocks. So I just went and edited
the EmbperlHTML syntax source file and removed all the bits that looked
like being related to tables. Under the Embperl source tree, this file
is in Embperl/Syntax/EmbperlHTML.pm. You need to recompile an reinstall
Embperl, obviously. This is (to me) a hack, but at least it might let
you experiment with a workaround...

Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe [at] perl
For additional commands, e-mail: embperl-help [at] perl


jthomp at midwestern

Jul 24, 2008, 9:56 AM

Post #3 of 5 (3199 views)
Permalink
RE: Stop embperl from messing with my code [In reply to]

I would try wrapping you're a tag in base.epl with these tags:

[$ syntax EmbperlBlocks $]

So it would look like:

<div id="upperband">
[$ syntax EmbperlBlocks $]
<a href="/" class="noborder"> [-
Execute('upperband.epl'); -]</a>
[$ syntax EmbperlBlocks $]
</div>

And no, white space for Embperl is like...messy.

-----Original Message-----
From: Jean-Christophe Boggio [mailto:embperl [at] thefreecat]
Sent: Thursday, July 24, 2008 1:42 AM
To: embperl [at] perl
Subject: Stop embperl from messing with my code

Hello,

I have really strange behaviours in my generated pages and I suspect
embperl to be "modifying" my html. I'd like to prevent this.

The case is this (I use Embperl Object) :

base.epl:
<div id="upperband">
<a href="/" class="noborder"> [-
Execute('upperband.epl'); -]</a>
</div>

upperband.epl:
<img src="/img/upperband_home.png" class="noborder" />

subdir/upperband.epl:
<img src="/img/upperband_subdir.png" class="noborder" />


As you see, I want a different image in the upper band depending on
where the
user is.

The problem lies in base.epl : immediately after the <a href="/"
class="noborder">
and before the [- Execute... -]

* If I leave the space, I get... a (vertical) space after the block.
* If I remove the space, the generated code is this :

<a href="/" class="noborder"<img src="/img/upperband_home.png"
class="noborder" />
></a>

So my "<a ...>" tag is broken and I see the ">" character.


Also, I take the care of having only one space between 'href="/"' and
'class=...'
and I'd like embperl not to add useless spaces. On a big page with lots
of tags
it becomes significant.


Is there a way to disable embperl's reinterpretation of the HTML code ?
I never
use the auto-table-like features.

Thanks,

--
Jean-Christophe Boggio -o)
embperl [at] thefreecat /\\
Independant Consultant and Developer _\_V

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe [at] perl
For additional commands, e-mail: embperl-help [at] perl


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe [at] perl
For additional commands, e-mail: embperl-help [at] perl


jthomp at midwestern

Jul 24, 2008, 10:00 AM

Post #4 of 5 (3217 views)
Permalink
RE: Stop embperl from messing with my code [In reply to]

I was rereading the page I where pulled that info. It's a little
confusing. Apparently there's a [$ syntax Embperl $] to try as well.

Here's the page:
http://www2.ecos.de/~mailarc/embperl/2005-09/msg00051.html

~Jon

-----Original Message-----
From: Thompson, Jon
Sent: Thursday, July 24, 2008 9:57 AM
To: 'embperl [at] perl'
Subject: RE: Stop embperl from messing with my code

I would try wrapping you're a tag in base.epl with these tags:

[$ syntax EmbperlBlocks $]

So it would look like:

<div id="upperband">
[$ syntax EmbperlBlocks $]
<a href="/" class="noborder"> [-
Execute('upperband.epl'); -]</a>
[$ syntax EmbperlBlocks $]
</div>

And no, white space for Embperl is like...messy.

-----Original Message-----
From: Jean-Christophe Boggio [mailto:embperl [at] thefreecat]
Sent: Thursday, July 24, 2008 1:42 AM
To: embperl [at] perl
Subject: Stop embperl from messing with my code

Hello,

I have really strange behaviours in my generated pages and I suspect
embperl to be "modifying" my html. I'd like to prevent this.

The case is this (I use Embperl Object) :

base.epl:
<div id="upperband">
<a href="/" class="noborder"> [-
Execute('upperband.epl'); -]</a>
</div>

upperband.epl:
<img src="/img/upperband_home.png" class="noborder" />

subdir/upperband.epl:
<img src="/img/upperband_subdir.png" class="noborder" />


As you see, I want a different image in the upper band depending on
where the
user is.

The problem lies in base.epl : immediately after the <a href="/"
class="noborder">
and before the [- Execute... -]

* If I leave the space, I get... a (vertical) space after the block.
* If I remove the space, the generated code is this :

<a href="/" class="noborder"<img src="/img/upperband_home.png"
class="noborder" />
></a>

So my "<a ...>" tag is broken and I see the ">" character.


Also, I take the care of having only one space between 'href="/"' and
'class=...'
and I'd like embperl not to add useless spaces. On a big page with lots
of tags
it becomes significant.


Is there a way to disable embperl's reinterpretation of the HTML code ?
I never
use the auto-table-like features.

Thanks,

--
Jean-Christophe Boggio -o)
embperl [at] thefreecat /\\
Independant Consultant and Developer _\_V

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe [at] perl
For additional commands, e-mail: embperl-help [at] perl


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe [at] perl
For additional commands, e-mail: embperl-help [at] perl


embperl at thefreecat

Jul 24, 2008, 5:59 PM

Post #5 of 5 (3183 views)
Permalink
Re: Stop embperl from messing with my code [In reply to]

Thompson, Jon a écrit :
> I was rereading the page I where pulled that info. It's a little
> confusing. Apparently there's a [$ syntax Embperl $] to try as well.
>
> Here's the page:
> http://www2.ecos.de/~mailarc/embperl/2005-09/msg00051.html

Thanks a million Jon. In fact it's quite simple :

[$ syntax EmbperlBlocks $]
Switches to what used to be called "optDisableHtmlScan" (more
self-explicit to me)

[$ syntax Embperl $]
Switches back to "normal" mode

Exactly what I was looking for. I won't see these ">" again.

--
(o- Jean-Christophe Boggio
//\
V_/_ Independant Consultant and Developer

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe [at] perl
For additional commands, e-mail: embperl-help [at] perl

ModPerl embperl RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.