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

Mailing List Archive: ModPerl: Embperl

Re: [SPAM] Breaking space in an [$ if $] block

 

 

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


spomerg at cwu

Jun 25, 2007, 8:26 AM

Post #1 of 4 (1865 views)
Permalink
Re: [SPAM] Breaking space in an [$ if $] block

Not quite sure what you mean by "breakable" space (as in "line break"?), but if you put a space immediately after the character 'C' in your example:

ABC [$ if (1==1) $] [$ endif $]123

it will output:

ABC 123

Is that what you wanted or have I misunderstood you?

Gavin Spomer
Systems Programmer
Brooks Library
Central Washington University

>>> Michael Smith <smithm [at] gmail> 06/25/07 4:32 AM >>>
Hi there,

I want to create a breakable space within my HTML.

Here's a short example:

ABC[$ if (1==1) $] [$ endif $]123

which outputs

ABC123 .. with no space despite there being a space in between [$ if
$] and [$ endif $]

I know I can put an but I actually want a breakable space. Is
there any way to achieve this?

Thanks

Michael

---------------------------------------------------------------------
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


earwig at taar

Jun 25, 2007, 9:03 AM

Post #2 of 4 (1732 views)
Permalink
RE: Breaking space in an [$ if $] block [In reply to]

He wants it conditional on the if. Try:

ABC[$ if (1==1) $]&#32;[$ endif $]123

Seems to work for me.


Lars



-----Original Message-----
From: Gavin Spomer [mailto:spomerg [at] cwu]
Sent: Monday, June 25, 2007 11:26 AM
To: embperl [at] perl
Subject: Re: [SPAM] Breaking space in an [$ if $] block

Not quite sure what you mean by "breakable" space (as in "line break"?),
but if you put a space immediately after the character 'C' in your
example:

ABC [$ if (1==1) $] [$ endif $]123

it will output:

ABC 123

Is that what you wanted or have I misunderstood you?

Gavin Spomer
Systems Programmer
Brooks Library
Central Washington University

>>> Michael Smith <smithm [at] gmail> 06/25/07 4:32 AM >>>
Hi there,

I want to create a breakable space within my HTML.

Here's a short example:

ABC[$ if (1==1) $] [$ endif $]123

which outputs

ABC123 .. with no space despite there being a space in between [$ if
$] and [$ endif $]

I know I can put an but I actually want a breakable space. Is
there any way to achieve this?

Thanks

Michael

---------------------------------------------------------------------
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


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


smithm at gmail

Jun 26, 2007, 1:45 AM

Post #3 of 4 (1719 views)
Permalink
Re: [SPAM] Breaking space in an [$ if $] block [In reply to]

Thanks guys

Actually I wanted the space to be conditional - ie for the code to putput

ABC123

sometimes

and

ABC 123

at other times.

So I need the space to be in an [$ if $] block



On 6/25/07, Gavin Spomer <spomerg [at] cwu> wrote:
> Not quite sure what you mean by "breakable" space (as in "line break"?), but if you put a space immediately after the character 'C' in your example:
>
> ABC [$ if (1==1) $] [$ endif $]123
>
> it will output:
>
> ABC 123
>
> Is that what you wanted or have I misunderstood you?
>
> Gavin Spomer
> Systems Programmer
> Brooks Library
> Central Washington University
>
> >>> Michael Smith <smithm [at] gmail> 06/25/07 4:32 AM >>>
> Hi there,
>
> I want to create a breakable space within my HTML.
>
> Here's a short example:
>
> ABC[$ if (1==1) $] [$ endif $]123
>
> which outputs
>
> ABC123 .. with no space despite there being a space in between [$ if
> $] and [$ endif $]
>
> I know I can put an but I actually want a breakable space. Is
> there any way to achieve this?
>
> Thanks
>
> Michael
>
> ---------------------------------------------------------------------
> 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
>
>

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


richter at ecos

Jun 29, 2007, 12:21 PM

Post #4 of 4 (1724 views)
Permalink
RE: Re: Breaking space in an [$ if $] block [In reply to]

>
> &#32; works great. Didn't know I could do that. Many thanks.
>
> Out of interest for a deeper understanding of embperl, why
> doesn't a regular space do the trick?
>

Embperl tries to remove "unnecessary" spaces from the output after
embedded code. Most time that is what you want, because otherwise you
end up with lot of space and newlines in your output.

You can avoid this behaviour by setting the value for optKeepSpaces in
EMBPERL_OPTIONS.

Also you can redefine the "if" or your own "if". Look at
Embperl/Syntax/EmbperlBlocks.pm in the definitions there is an attribute
called removenode. If your write 8 instead of 10, it will not remove the
space form the output. See perldoc Embperl::Syntax for docs

Gerald



> Thanks
>
> Michael
>
> On 6/25/07, Lars Kelto <earwig [at] taar> wrote:
> > He wants it conditional on the if. Try:
> >
> > ABC[$ if (1==1) $]&#32;[$ endif $]123
> >
> > Seems to work for me.
> >
> >
> > Lars
> >
> >
> >
> > -----Original Message-----
> > From: Gavin Spomer [mailto:spomerg [at] cwu]
> > Sent: Monday, June 25, 2007 11:26 AM
> > To: embperl [at] perl
> > Subject: Re: [SPAM] Breaking space in an [$ if $] block
> >
> > Not quite sure what you mean by "breakable" space (as in "line
> > break"?), but if you put a space immediately after the
> character 'C'
> > in your
> > example:
> >
> > ABC [$ if (1==1) $] [$ endif $]123
> >
> > it will output:
> >
> > ABC 123
> >
> > Is that what you wanted or have I misunderstood you?
> >
> > Gavin Spomer
> > Systems Programmer
> > Brooks Library
> > Central Washington University
> >
> > >>> Michael Smith <smithm [at] gmail> 06/25/07 4:32 AM >>>
> > Hi there,
> >
> > I want to create a breakable space within my HTML.
> >
> > Here's a short example:
> >
> > ABC[$ if (1==1) $] [$ endif $]123
> >
> > which outputs
> >
> > ABC123 .. with no space despite there being a space in
> between [$ if
> > $] and [$ endif $]
> >
> > I know I can put an but I actually want a breakable space. Is
> > there any way to achieve this?
> >
> > Thanks
> >
> > Michael
> >
> >
> ---------------------------------------------------------------------
> > 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
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe [at] perl
> For additional commands, e-mail: embperl-help [at] perl
>
>
> ** Virus checked by BB-5000 Mailfilter **
> !DSPAM:416,4680d462195008199815696!
>
>

** Virus checked by BB-5000 Mailfilter **

---------------------------------------------------------------------
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.