You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Paul Stanton <pa...@mapshed.com.au> on 2010/07/15 06:27:32 UTC

production html whitespace compression alters rendered markup

Firstly, I'd like to say that tapestry does most things very well and I 
probably only comment on the things it doesn't do well. Thank you to 
those who've spent time improving the framework for making my job as a 
developer more enjoyable.

I do have an issue with the production mode Considering the following in 
your average TML:

<p>This is my paragraph and sometimes a single word or phrase <span 
style="text-decoration:underline;">might need some special 
attention</span> <span style="font-weight:bold;">so I might do 
this</span>, but it's still <span style="font-style:italic;">my</span> 
paragraph.</p>

or a shorter eg:
<p>A <span>B</span> <span>C</span> D</p>

In development mode, this will render unchanged:

A B C D

However in production mode, tapestry will take out some important 
whitespace:

A BC D

I know you can partially combat this by using a non-breaking space in 
the markup (&nbsp;) however, this has the expected drawback of 
disallowing line breaking where it may be required.

for example, a list of links:
<a href="url1">1</a>
<a href="url2">2</a>
<a href="url3">3</a>
<a href="url4">4</a>
<a href="url5">5</a>
...

becomes
<a href="url1">1</a><a href="url2">2</a><a href="url3">3</a><a 
href="url4">4</a><a href="url5">5</a>...

I agree that some 'compression' on html syntax is a good thing in a 
production environment, but to keep the integrity of the document I 
think tapestry should replace multiple whitespace characters with one 
whitespace character instead of removing all whitespace between tags. 
Therefore, while I know I can set "tapestry.compress-whitespace" to 
false, I would prefer to have my suggestion implemented in place of the 
existing mechanism or as an alternative.

The main issues for me:
1. Rendered markup is fundamentally different between production and 
development environments, making the most commonly used form of testing 
flawed
2. In some cases a space is the only solution to layout problems and 
tapestry won't allow it

Keen to hear other opinions...

p.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: production html whitespace compression alters rendered markup

Posted by Christophe Cordenier <ch...@gmail.com>.
Hi,

2010/7/15 Paul Stanton <pa...@mapshed.com.au>

> Firstly, I'd like to say that tapestry does most things very well and I
> probably only comment on the things it doesn't do well. Thank you to those
> who've spent time improving the framework for making my job as a developer
> more enjoyable.
>
> I do have an issue with the production mode Considering the following in
> your average TML:
>
> <p>This is my paragraph and sometimes a single word or phrase <span
> style="text-decoration:underline;">might need some special attention</span>
> <span style="font-weight:bold;">so I might do this</span>, but it's still
> <span style="font-style:italic;">my</span> paragraph.</p>
>
> or a shorter eg:
> <p>A <span>B</span> <span>C</span> D</p>
>
>
I would use CSS for SPAN element and &nbsp; where it's really needed


> In development mode, this will render unchanged:
>
> A B C D
>
> However in production mode, tapestry will take out some important
> whitespace:
>
> A BC D
>
> I know you can partially combat this by using a non-breaking space in the
> markup (&nbsp;) however, this has the expected drawback of disallowing line
> breaking where it may be required.
>
> for example, a list of links:
> <a href="url1">1</a>
> <a href="url2">2</a>
> <a href="url3">3</a>
> <a href="url4">4</a>
> <a href="url5">5</a>
> ...
>

For this, i would use a list <li> with some CSS to handle the display



> becomes
> <a href="url1">1</a><a href="url2">2</a><a href="url3">3</a><a
> href="url4">4</a><a href="url5">5</a>...
>
> I agree that some 'compression' on html syntax is a good thing in a
> production environment, but to keep the integrity of the document I think
> tapestry should replace multiple whitespace characters with one whitespace
> character instead of removing all whitespace between tags. Therefore, while
> I know I can set "tapestry.compress-whitespace" to false, I would prefer to
> have my suggestion implemented in place of the existing mechanism or as an
> alternative.
>
> The main issues for me:
> 1. Rendered markup is fundamentally different between production and
> development environments, making the most commonly used form of testing
> flawed
> 2. In some cases a space is the only solution to layout problems and
> tapestry won't allow it
>
> Keen to hear other opinions...
>
> p.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Regards,
Christophe Cordenier.

Committer on Apache Tapestry 5
Co-creator of wooki @wookicentral.com

Re: production html whitespace compression alters rendered markup

Posted by "Joost Schouten (ml)" <jo...@jsportal.com>.
I agree Paul,

I have been using configuration.add(SymbolConstants.COMPRESS_WHITESPACE, 
"false"); for a while as a quick fix. But I too believe the white space 
compression can be a bit more intelligent and leave one space between 
tags if there are any.

My 2 cents,
Joost

Paul Stanton wrote:
> Firstly, I'd like to say that tapestry does most things very well and 
> I probably only comment on the things it doesn't do well. Thank you to 
> those who've spent time improving the framework for making my job as a 
> developer more enjoyable.
>
> I do have an issue with the production mode Considering the following 
> in your average TML:
>
> <p>This is my paragraph and sometimes a single word or phrase <span 
> style="text-decoration:underline;">might need some special 
> attention</span> <span style="font-weight:bold;">so I might do 
> this</span>, but it's still <span style="font-style:italic;">my</span> 
> paragraph.</p>
>
> or a shorter eg:
> <p>A <span>B</span> <span>C</span> D</p>
>
> In development mode, this will render unchanged:
>
> A B C D
>
> However in production mode, tapestry will take out some important 
> whitespace:
>
> A BC D
>
> I know you can partially combat this by using a non-breaking space in 
> the markup (&nbsp;) however, this has the expected drawback of 
> disallowing line breaking where it may be required.
>
> for example, a list of links:
> <a href="url1">1</a>
> <a href="url2">2</a>
> <a href="url3">3</a>
> <a href="url4">4</a>
> <a href="url5">5</a>
> ...
>
> becomes
> <a href="url1">1</a><a href="url2">2</a><a href="url3">3</a><a 
> href="url4">4</a><a href="url5">5</a>...
>
> I agree that some 'compression' on html syntax is a good thing in a 
> production environment, but to keep the integrity of the document I 
> think tapestry should replace multiple whitespace characters with one 
> whitespace character instead of removing all whitespace between tags. 
> Therefore, while I know I can set "tapestry.compress-whitespace" to 
> false, I would prefer to have my suggestion implemented in place of 
> the existing mechanism or as an alternative.
>
> The main issues for me:
> 1. Rendered markup is fundamentally different between production and 
> development environments, making the most commonly used form of 
> testing flawed
> 2. In some cases a space is the only solution to layout problems and 
> tapestry won't allow it
>
> Keen to hear other opinions...
>
> p.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: production html whitespace compression alters rendered markup

Posted by Josh Canfield <jo...@gmail.com>.
> If only Tapestry were written in Clojure :-)

Yep, no users, no feature requests, no bugs :P

On Fri, Jul 16, 2010 at 8:36 AM, Howard Lewis Ship <hl...@gmail.com> wrote:
> Actually, I doubt that; it's well integrated into the template parser,
> not broken out into a separate service.  If only Tapestry were written
> in Clojure :-)
>
> On Fri, Jul 16, 2010 at 5:26 AM, Inge Solvoll <in...@gmail.com> wrote:
>> As always, I'm pretty sure it's possible and not too hard to decorate the
>> built-in service that does this work :)
>>
>> On Fri, Jul 16, 2010 at 5:53 AM, Paul Stanton <pa...@mapshed.com.au> wrote:
>>
>>> thanks for the suggestion howard, this would be fine if it were obvious to
>>> all developers which cases were problematic. otherwise it's a case of
>>> putting out spot fires which isn't good.
>>>
>>> i still think making the whitespace compressor more intelligent ie
>>> replacing multiple whitespace chars with a single space is preferable. that
>>> way we still get 99% of the benefits of compression yet none of the
>>> drawbacks.
>>>
>>> is there a way to override the implementation of the class that does this?
>>>
>>> regards, paul.
>>>
>>>
>>> Howard Lewis Ship wrote:
>>>
>>>> Where whitespace counts, add an xml:space="preserve" attribute to the
>>>> enclosing tag, i.e.
>>>>
>>>> <p xml:space="preserve">This is my paragraph and sometimes a single
>>>> word or phrase <span style="text-decoration:underline;">might need
>>>> some special attention</span> <span style="font-weight:bold;">so I
>>>> might do this</span>, but it's still <span
>>>> style="font-style:italic;">my</span> paragraph.</p>
>>>>
>>>>
>>>>
>>>> On Wed, Jul 14, 2010 at 9:27 PM, Paul Stanton <pa...@mapshed.com.au>
>>>> wrote:
>>>>
>>>>
>>>>> Firstly, I'd like to say that tapestry does most things very well and I
>>>>> probably only comment on the things it doesn't do well. Thank you to
>>>>> those
>>>>> who've spent time improving the framework for making my job as a
>>>>> developer
>>>>> more enjoyable.
>>>>>
>>>>> I do have an issue with the production mode Considering the following in
>>>>> your average TML:
>>>>>
>>>>> <p>This is my paragraph and sometimes a single word or phrase <span
>>>>> style="text-decoration:underline;">might need some special
>>>>> attention</span>
>>>>> <span style="font-weight:bold;">so I might do this</span>, but it's still
>>>>> <span style="font-style:italic;">my</span> paragraph.</p>
>>>>>
>>>>> or a shorter eg:
>>>>> <p>A <span>B</span> <span>C</span> D</p>
>>>>>
>>>>> In development mode, this will render unchanged:
>>>>>
>>>>> A B C D
>>>>>
>>>>> However in production mode, tapestry will take out some important
>>>>> whitespace:
>>>>>
>>>>> A BC D
>>>>>
>>>>> I know you can partially combat this by using a non-breaking space in the
>>>>> markup (&nbsp;) however, this has the expected drawback of disallowing
>>>>> line
>>>>> breaking where it may be required.
>>>>>
>>>>> for example, a list of links:
>>>>> <a href="url1">1</a>
>>>>> <a href="url2">2</a>
>>>>> <a href="url3">3</a>
>>>>> <a href="url4">4</a>
>>>>> <a href="url5">5</a>
>>>>> ...
>>>>>
>>>>> becomes
>>>>> <a href="url1">1</a><a href="url2">2</a><a href="url3">3</a><a
>>>>> href="url4">4</a><a href="url5">5</a>...
>>>>>
>>>>> I agree that some 'compression' on html syntax is a good thing in a
>>>>> production environment, but to keep the integrity of the document I think
>>>>> tapestry should replace multiple whitespace characters with one
>>>>> whitespace
>>>>> character instead of removing all whitespace between tags. Therefore,
>>>>> while
>>>>> I know I can set "tapestry.compress-whitespace" to false, I would prefer
>>>>> to
>>>>> have my suggestion implemented in place of the existing mechanism or as
>>>>> an
>>>>> alternative.
>>>>>
>>>>> The main issues for me:
>>>>> 1. Rendered markup is fundamentally different between production and
>>>>> development environments, making the most commonly used form of testing
>>>>> flawed
>>>>> 2. In some cases a space is the only solution to layout problems and
>>>>> tapestry won't allow it
>>>>>
>>>>> Keen to hear other opinions...
>>>>>
>>>>> p.
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator of Apache Tapestry
>
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
>
> (971) 678-5210
> http://howardlewisship.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
--
http://www.bodylabgym.com - a private, by appointment only, one-on-one
health and fitness facility.
--
http://www.ectransition.com - Quality Electronic Cigarettes at a
reasonable price!
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: production html whitespace compression alters rendered markup

Posted by Howard Lewis Ship <hl...@gmail.com>.
Actually, I doubt that; it's well integrated into the template parser,
not broken out into a separate service.  If only Tapestry were written
in Clojure :-)

On Fri, Jul 16, 2010 at 5:26 AM, Inge Solvoll <in...@gmail.com> wrote:
> As always, I'm pretty sure it's possible and not too hard to decorate the
> built-in service that does this work :)
>
> On Fri, Jul 16, 2010 at 5:53 AM, Paul Stanton <pa...@mapshed.com.au> wrote:
>
>> thanks for the suggestion howard, this would be fine if it were obvious to
>> all developers which cases were problematic. otherwise it's a case of
>> putting out spot fires which isn't good.
>>
>> i still think making the whitespace compressor more intelligent ie
>> replacing multiple whitespace chars with a single space is preferable. that
>> way we still get 99% of the benefits of compression yet none of the
>> drawbacks.
>>
>> is there a way to override the implementation of the class that does this?
>>
>> regards, paul.
>>
>>
>> Howard Lewis Ship wrote:
>>
>>> Where whitespace counts, add an xml:space="preserve" attribute to the
>>> enclosing tag, i.e.
>>>
>>> <p xml:space="preserve">This is my paragraph and sometimes a single
>>> word or phrase <span style="text-decoration:underline;">might need
>>> some special attention</span> <span style="font-weight:bold;">so I
>>> might do this</span>, but it's still <span
>>> style="font-style:italic;">my</span> paragraph.</p>
>>>
>>>
>>>
>>> On Wed, Jul 14, 2010 at 9:27 PM, Paul Stanton <pa...@mapshed.com.au>
>>> wrote:
>>>
>>>
>>>> Firstly, I'd like to say that tapestry does most things very well and I
>>>> probably only comment on the things it doesn't do well. Thank you to
>>>> those
>>>> who've spent time improving the framework for making my job as a
>>>> developer
>>>> more enjoyable.
>>>>
>>>> I do have an issue with the production mode Considering the following in
>>>> your average TML:
>>>>
>>>> <p>This is my paragraph and sometimes a single word or phrase <span
>>>> style="text-decoration:underline;">might need some special
>>>> attention</span>
>>>> <span style="font-weight:bold;">so I might do this</span>, but it's still
>>>> <span style="font-style:italic;">my</span> paragraph.</p>
>>>>
>>>> or a shorter eg:
>>>> <p>A <span>B</span> <span>C</span> D</p>
>>>>
>>>> In development mode, this will render unchanged:
>>>>
>>>> A B C D
>>>>
>>>> However in production mode, tapestry will take out some important
>>>> whitespace:
>>>>
>>>> A BC D
>>>>
>>>> I know you can partially combat this by using a non-breaking space in the
>>>> markup (&nbsp;) however, this has the expected drawback of disallowing
>>>> line
>>>> breaking where it may be required.
>>>>
>>>> for example, a list of links:
>>>> <a href="url1">1</a>
>>>> <a href="url2">2</a>
>>>> <a href="url3">3</a>
>>>> <a href="url4">4</a>
>>>> <a href="url5">5</a>
>>>> ...
>>>>
>>>> becomes
>>>> <a href="url1">1</a><a href="url2">2</a><a href="url3">3</a><a
>>>> href="url4">4</a><a href="url5">5</a>...
>>>>
>>>> I agree that some 'compression' on html syntax is a good thing in a
>>>> production environment, but to keep the integrity of the document I think
>>>> tapestry should replace multiple whitespace characters with one
>>>> whitespace
>>>> character instead of removing all whitespace between tags. Therefore,
>>>> while
>>>> I know I can set "tapestry.compress-whitespace" to false, I would prefer
>>>> to
>>>> have my suggestion implemented in place of the existing mechanism or as
>>>> an
>>>> alternative.
>>>>
>>>> The main issues for me:
>>>> 1. Rendered markup is fundamentally different between production and
>>>> development environments, making the most commonly used form of testing
>>>> flawed
>>>> 2. In some cases a space is the only solution to layout problems and
>>>> tapestry won't allow it
>>>>
>>>> Keen to hear other opinions...
>>>>
>>>> p.
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>>
>>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: production html whitespace compression alters rendered markup

Posted by Inge Solvoll <in...@gmail.com>.
As always, I'm pretty sure it's possible and not too hard to decorate the
built-in service that does this work :)

On Fri, Jul 16, 2010 at 5:53 AM, Paul Stanton <pa...@mapshed.com.au> wrote:

> thanks for the suggestion howard, this would be fine if it were obvious to
> all developers which cases were problematic. otherwise it's a case of
> putting out spot fires which isn't good.
>
> i still think making the whitespace compressor more intelligent ie
> replacing multiple whitespace chars with a single space is preferable. that
> way we still get 99% of the benefits of compression yet none of the
> drawbacks.
>
> is there a way to override the implementation of the class that does this?
>
> regards, paul.
>
>
> Howard Lewis Ship wrote:
>
>> Where whitespace counts, add an xml:space="preserve" attribute to the
>> enclosing tag, i.e.
>>
>> <p xml:space="preserve">This is my paragraph and sometimes a single
>> word or phrase <span style="text-decoration:underline;">might need
>> some special attention</span> <span style="font-weight:bold;">so I
>> might do this</span>, but it's still <span
>> style="font-style:italic;">my</span> paragraph.</p>
>>
>>
>>
>> On Wed, Jul 14, 2010 at 9:27 PM, Paul Stanton <pa...@mapshed.com.au>
>> wrote:
>>
>>
>>> Firstly, I'd like to say that tapestry does most things very well and I
>>> probably only comment on the things it doesn't do well. Thank you to
>>> those
>>> who've spent time improving the framework for making my job as a
>>> developer
>>> more enjoyable.
>>>
>>> I do have an issue with the production mode Considering the following in
>>> your average TML:
>>>
>>> <p>This is my paragraph and sometimes a single word or phrase <span
>>> style="text-decoration:underline;">might need some special
>>> attention</span>
>>> <span style="font-weight:bold;">so I might do this</span>, but it's still
>>> <span style="font-style:italic;">my</span> paragraph.</p>
>>>
>>> or a shorter eg:
>>> <p>A <span>B</span> <span>C</span> D</p>
>>>
>>> In development mode, this will render unchanged:
>>>
>>> A B C D
>>>
>>> However in production mode, tapestry will take out some important
>>> whitespace:
>>>
>>> A BC D
>>>
>>> I know you can partially combat this by using a non-breaking space in the
>>> markup (&nbsp;) however, this has the expected drawback of disallowing
>>> line
>>> breaking where it may be required.
>>>
>>> for example, a list of links:
>>> <a href="url1">1</a>
>>> <a href="url2">2</a>
>>> <a href="url3">3</a>
>>> <a href="url4">4</a>
>>> <a href="url5">5</a>
>>> ...
>>>
>>> becomes
>>> <a href="url1">1</a><a href="url2">2</a><a href="url3">3</a><a
>>> href="url4">4</a><a href="url5">5</a>...
>>>
>>> I agree that some 'compression' on html syntax is a good thing in a
>>> production environment, but to keep the integrity of the document I think
>>> tapestry should replace multiple whitespace characters with one
>>> whitespace
>>> character instead of removing all whitespace between tags. Therefore,
>>> while
>>> I know I can set "tapestry.compress-whitespace" to false, I would prefer
>>> to
>>> have my suggestion implemented in place of the existing mechanism or as
>>> an
>>> alternative.
>>>
>>> The main issues for me:
>>> 1. Rendered markup is fundamentally different between production and
>>> development environments, making the most commonly used form of testing
>>> flawed
>>> 2. In some cases a space is the only solution to layout problems and
>>> tapestry won't allow it
>>>
>>> Keen to hear other opinions...
>>>
>>> p.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>>
>

Re: production html whitespace compression alters rendered markup

Posted by Paul Stanton <pa...@mapshed.com.au>.
thanks for the suggestion howard, this would be fine if it were obvious 
to all developers which cases were problematic. otherwise it's a case of 
putting out spot fires which isn't good.

i still think making the whitespace compressor more intelligent ie 
replacing multiple whitespace chars with a single space is preferable. 
that way we still get 99% of the benefits of compression yet none of the 
drawbacks.

is there a way to override the implementation of the class that does this?

regards, paul.

Howard Lewis Ship wrote:
> Where whitespace counts, add an xml:space="preserve" attribute to the
> enclosing tag, i.e.
>
> <p xml:space="preserve">This is my paragraph and sometimes a single
> word or phrase <span style="text-decoration:underline;">might need
> some special attention</span> <span style="font-weight:bold;">so I
> might do this</span>, but it's still <span
> style="font-style:italic;">my</span> paragraph.</p>
>
>
>
> On Wed, Jul 14, 2010 at 9:27 PM, Paul Stanton <pa...@mapshed.com.au> wrote:
>   
>> Firstly, I'd like to say that tapestry does most things very well and I
>> probably only comment on the things it doesn't do well. Thank you to those
>> who've spent time improving the framework for making my job as a developer
>> more enjoyable.
>>
>> I do have an issue with the production mode Considering the following in
>> your average TML:
>>
>> <p>This is my paragraph and sometimes a single word or phrase <span
>> style="text-decoration:underline;">might need some special attention</span>
>> <span style="font-weight:bold;">so I might do this</span>, but it's still
>> <span style="font-style:italic;">my</span> paragraph.</p>
>>
>> or a shorter eg:
>> <p>A <span>B</span> <span>C</span> D</p>
>>
>> In development mode, this will render unchanged:
>>
>> A B C D
>>
>> However in production mode, tapestry will take out some important
>> whitespace:
>>
>> A BC D
>>
>> I know you can partially combat this by using a non-breaking space in the
>> markup (&nbsp;) however, this has the expected drawback of disallowing line
>> breaking where it may be required.
>>
>> for example, a list of links:
>> <a href="url1">1</a>
>> <a href="url2">2</a>
>> <a href="url3">3</a>
>> <a href="url4">4</a>
>> <a href="url5">5</a>
>> ...
>>
>> becomes
>> <a href="url1">1</a><a href="url2">2</a><a href="url3">3</a><a
>> href="url4">4</a><a href="url5">5</a>...
>>
>> I agree that some 'compression' on html syntax is a good thing in a
>> production environment, but to keep the integrity of the document I think
>> tapestry should replace multiple whitespace characters with one whitespace
>> character instead of removing all whitespace between tags. Therefore, while
>> I know I can set "tapestry.compress-whitespace" to false, I would prefer to
>> have my suggestion implemented in place of the existing mechanism or as an
>> alternative.
>>
>> The main issues for me:
>> 1. Rendered markup is fundamentally different between production and
>> development environments, making the most commonly used form of testing
>> flawed
>> 2. In some cases a space is the only solution to layout problems and
>> tapestry won't allow it
>>
>> Keen to hear other opinions...
>>
>> p.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>     
>
>
>
>   

Re: production html whitespace compression alters rendered markup

Posted by Howard Lewis Ship <hl...@gmail.com>.
Where whitespace counts, add an xml:space="preserve" attribute to the
enclosing tag, i.e.

<p xml:space="preserve">This is my paragraph and sometimes a single
word or phrase <span style="text-decoration:underline;">might need
some special attention</span> <span style="font-weight:bold;">so I
might do this</span>, but it's still <span
style="font-style:italic;">my</span> paragraph.</p>



On Wed, Jul 14, 2010 at 9:27 PM, Paul Stanton <pa...@mapshed.com.au> wrote:
> Firstly, I'd like to say that tapestry does most things very well and I
> probably only comment on the things it doesn't do well. Thank you to those
> who've spent time improving the framework for making my job as a developer
> more enjoyable.
>
> I do have an issue with the production mode Considering the following in
> your average TML:
>
> <p>This is my paragraph and sometimes a single word or phrase <span
> style="text-decoration:underline;">might need some special attention</span>
> <span style="font-weight:bold;">so I might do this</span>, but it's still
> <span style="font-style:italic;">my</span> paragraph.</p>
>
> or a shorter eg:
> <p>A <span>B</span> <span>C</span> D</p>
>
> In development mode, this will render unchanged:
>
> A B C D
>
> However in production mode, tapestry will take out some important
> whitespace:
>
> A BC D
>
> I know you can partially combat this by using a non-breaking space in the
> markup (&nbsp;) however, this has the expected drawback of disallowing line
> breaking where it may be required.
>
> for example, a list of links:
> <a href="url1">1</a>
> <a href="url2">2</a>
> <a href="url3">3</a>
> <a href="url4">4</a>
> <a href="url5">5</a>
> ...
>
> becomes
> <a href="url1">1</a><a href="url2">2</a><a href="url3">3</a><a
> href="url4">4</a><a href="url5">5</a>...
>
> I agree that some 'compression' on html syntax is a good thing in a
> production environment, but to keep the integrity of the document I think
> tapestry should replace multiple whitespace characters with one whitespace
> character instead of removing all whitespace between tags. Therefore, while
> I know I can set "tapestry.compress-whitespace" to false, I would prefer to
> have my suggestion implemented in place of the existing mechanism or as an
> alternative.
>
> The main issues for me:
> 1. Rendered markup is fundamentally different between production and
> development environments, making the most commonly used form of testing
> flawed
> 2. In some cases a space is the only solution to layout problems and
> tapestry won't allow it
>
> Keen to hear other opinions...
>
> p.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org