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

Mailing List Archive: ModPerl: Embperl

Breaking space in an [$ if $] block

 

 

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


smithm at gmail

Jun 25, 2007, 4:32 AM

Post #1 of 7 (2436 views)
Permalink
Breaking space in an [$ if $] block

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


bkim at tamu

Jun 25, 2007, 9:16 AM

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

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

ABC[+(1==1)?" ":""+]123


Ben K.
Developer
http://benix.tamu.edu

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


smithm at gmail

Jun 26, 2007, 1:47 AM

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

  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?

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


spomerg at cwu

Jun 26, 2007, 8:06 AM

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

&#32; is the same as &nbsp; (hopefully your email program will not escape what I'm showing you like mine did)

Weren't you trying to avoid using &nbsp;?

- Gavin

>>> Michael Smith <smithm [at] gmail> 06/26/07 1:47 AM >>>
&#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?

Thanks

Michael

On 6/25/07, Lars Kelto <earwig [at] taar> wrote:
> He wants it conditional on the if. Try:
>
> ABC[$ if (1==1) $] [$ 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



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


smithm at gmail

Jun 26, 2007, 8:29 AM

Post #5 of 7 (2284 views)
Permalink
Re: Breaking space in an [$ if $] block [In reply to]

Hi Gavin,

I guess I need to find IE to check this, but on firefox &#32; allows
wrapping, as per:

http://dev.savingforchildren.co.uk/mjs/testspace.epl

Michael

On 6/26/07, Gavin Spomer <spomerg [at] cwu> wrote:
> &#32; is the same as &nbsp; (hopefully your email program will not escape what I'm showing you like mine did)
>
> Weren't you trying to avoid using &nbsp;?
>
> - Gavin
>
> >>> Michael Smith <smithm [at] gmail> 06/26/07 1:47 AM >>>
> &#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?
>
> Thanks
>
> Michael
>
> On 6/25/07, Lars Kelto <earwig [at] taar> wrote:
> > He wants it conditional on the if. Try:
> >
> > ABC[$ if (1==1) $] [$ 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
>
>
>
> ---------------------------------------------------------------------
> 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


edgrimm at dsblade00

Jun 26, 2007, 10:09 AM

Post #6 of 7 (2289 views)
Permalink
Re: Breaking space in an [$ if $] block [In reply to]

&#160; is the same as &nbsp;. &#32; is a normal space. Incidentally,
for indivuals trying to compress their documents as much as possible
without resorting to techniques such as server-side stream
decompression, using a litteral ' ' character (chr(160)) is also the
same as &nbsp;. I would personally advise against it, as most text
editors do not show it as a different character than space. Also note
that the high bit may get lost in email encoding, so it's possible that
the character in quotes will be converted to a normal space by the time
it gets to you....

Ed

On Tue, 26 Jun 2007, Gavin Spomer wrote:

> &#32; is the same as &nbsp; (hopefully your email program will not
> escape what I'm showing you like mine did)
>
> Weren't you trying to avoid using &nbsp;?
>
> - Gavin
>
> >>> Michael Smith <smithm [at] gmail> 06/26/07 1:47 AM >>>
> &#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?
>
> Thanks
>
> Michael
>
> On 6/25/07, Lars Kelto <earwig [at] taar> wrote:
> > He wants it conditional on the if. Try:
> >
> > ABC[$ if (1==1) $] [$ 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
>
>
>
> ---------------------------------------------------------------------
> 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


cliff at rayman

Jun 26, 2007, 3:31 PM

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

It has to do with HTML, not Embperl. Generally, whitespace in an HTML
document is ignored. The &32; or otherwise written as &nsbsp; is a
non-breaking space and specifically not ignored.

Cliff

Michael Smith wrote:
> &#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?
>
> 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


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