trimSpaces removing whitespace from html

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
26 messages Options
12
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

trimSpaces removing whitespace from html

David Kavanagh
Hey,

I am wondering if anyone has come across this issue, and hopefully a way to fix it.
When i enable the trimSpaces configuration option it removes the whitespace but also 
removes some whitespace from particular areas of the html. In my case, it removes white space between some of the classes in a class=" class1 class2 class3" string. In one case, the first example, it actually removes text as well. I am running Tomcat version 8.0.15.

Here are some examples:

1. Before
1. After


2. Before

2. After


3. Before


3. After

Any advice on this would be greatly appreciated.

Kind Regards

David

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: trimSpaces removing whitespace from html

Mark Thomas-2
On 10/05/17 17:17, David Kavanagh wrote:

> Hey,
>
> I am wondering if anyone has come across this issue, and hopefully a way
> to fix it.
> When i enable the trimSpaces configuration option it removes the
> whitespace but also
> removes some whitespace from particular areas of the html. In my case,
> it removes white space between some of the classes in a class=" class1
> class2 class3" string. In one case, the first example, it actually
> removes text as well. I am running Tomcat version 8.0.15.
>
> Here are some examples:

The in-line images are removed by the list software.

If you can include the example source and resulting HTML snippets
in-line, that would work better.

Mark



> Any advice on this would be greatly appreciated.
>
> Kind Regards
>
> David
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: trimSpaces removing whitespace from html

David Kavanagh
Thanks for the quick reply.

This is the code that i added to the web.xml file to activate trimSpaces:

        <init-param>
            <param-name>trimSpaces</param-name>
            <param-value>true</param-value>
        </init-param>

This is the HTML code:

1. Before

class="mrf-article mrf-article--photo mrf-page mrf-noFillet mrf-author
mrf-m mrf-image ">


1.After


class="mrf-article mrf-article--photo mrf-page mrf-noFillet mrf-author
mrf-mmrf-image">


2.Before

class="mrf-article mrf-article--photo mrf-page mrf-noFillet mrf-author
mrf-video mrf-m mrf-image ">


2.After


class="mrf-article mrf-article--photo mrf-page mrf-noFillet mrf-author
mrf-mmrf-image">


3.Before

<li id="mrf-messenger" class="mrf-shareOption mrf-brandBkg
mrf-messenger mrf-hidden">


3.After

<li id="mrf-messenger" class="mrf-shareOption mrf-brandBkg
mrf-messengermrf-hidden">


There are many more incidents of the same thing happening.


Thanks


On 10 May 2017 at 20:13, Mark Thomas <[hidden email]> wrote:

> On 10/05/17 17:17, David Kavanagh wrote:
> > Hey,
> >
> > I am wondering if anyone has come across this issue, and hopefully a way
> > to fix it.
> > When i enable the trimSpaces configuration option it removes the
> > whitespace but also
> > removes some whitespace from particular areas of the html. In my case,
> > it removes white space between some of the classes in a class=" class1
> > class2 class3" string. In one case, the first example, it actually
> > removes text as well. I am running Tomcat version 8.0.15.
> >
> > Here are some examples:
>
> The in-line images are removed by the list software.
>
> If you can include the example source and resulting HTML snippets
> in-line, that would work better.
>
> Mark
>
>
>
> > Any advice on this would be greatly appreciated.
> >
> > Kind Regards
> >
> > David
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: trimSpaces removing whitespace from html

Christopher Schultz-2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256



David,

On 5/11/17 3:27 AM, David Kavanagh wrote:
> Thanks for the quick reply.
>
> This is the code that i added to the web.xml file to activate
trimSpaces:

>
> <init-param> <param-name>trimSpaces</param-name>
> <param-value>true</param-value> </init-param>
>
> This is the HTML code:
>
> 1. Before
>
> class="mrf-article mrf-article--photo mrf-page mrf-noFillet
> mrf-author mrf-m mrf-image ">
>
>
> 1.After
>
>
> class="mrf-article mrf-article--photo mrf-page mrf-noFillet
> mrf-author mrf-mmrf-image">

So, removing the trailing space in the "class" attribute's value?

> 2.Before
>
> class="mrf-article mrf-article--photo mrf-page mrf-noFillet
> mrf-author mrf-video mrf-m mrf-image ">
>
>
> 2.After
>
>
> class="mrf-article mrf-article--photo mrf-page mrf-noFillet
> mrf-author mrf-mmrf-image">

This is the same thing, right?

> 3.Before
>
> <li id="mrf-messenger" class="mrf-shareOption mrf-brandBkg
> mrf-messenger mrf-hidden">
>
>
> 3.After
>
> <li id="mrf-messenger" class="mrf-shareOption mrf-brandBkg
> mrf-messengermrf-hidden">

And here as well?

> There are many more incidents of the same thing happening.

Are you using .jsp or .jspx?

If .jspx, then you are subject to the XML spec's rules for normalizing
element attribute values[1]. Specifically, this part:

"
[T]he XML processor MUST further process the normalized attribute value
by discarding any leading and trailing space (#x20) characters[.]
"

- -chris

[1] https://www.w3.org/TR/REC-xml/#AVNormalize


-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlkUZewACgkQHPApP6U8
pFgaUw/9HQYmHdTsQvt9UppCrRbp+2MAJ0CbyC9VdEvtjscMJ7e0McZCKEeBVRsv
XBIAjO4DH+fbQhSXojBwOdV6uaNCqBbUCrvnx6INcDTCSa0LG81DgZvjSa7gsY/b
Nv4OHPfFqVX38UPj6hsR+/PH8ZZ4rI7CUMRwrR3Dy8k//qdUWXY+TrOaTVx/OaIN
tqD5sKQUjT+TapyF0iSfI/dpP1RSfz6pJvVIQQAl42+UkzHunti0pcEWqwsj6+vM
Ubq9vA+9PUN6dOtPRM4WpBNYWgpNfRLLWvF0zgmy1aNBUJewZc4EVL69yWk67PKj
UymWV/oEhPPnHq2xpPG852D21su28aSZ3IRUlIYWioAzCZ8KZAZrSwEezIJ+3bzm
XNNQD45HO7QDRhD+msKTaR8FXuEnrRvXZ/wpro+mb0nNa9rBPswKPEPqh12WL/nH
CzGEwi4tyikz8sH5M/huMpw9kbn9+wNsMKbqNKOQQgBPA0/RwHFi7M5J+BLYqpwx
HlpdRpFy+HOdnDT7qhdm4q27iRszbf78+O2nTKVXFAv37BO08tSh+KG3rrkZecyL
QEIFNBEnQYt+S+7PmL0QClGSnYU9Thli+YAeydvnkcGCfLJdXT4LcVszTucTyaB/
YgZ/h3ubiWqukWL1H+4xmzNFwlaHVR86XA59kYf6B3xiAkQyblI=
=tWgw
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: trimSpaces removing whitespace from html

Torsten Krah-2
Am Donnerstag, den 11.05.2017, 09:23 -0400 schrieb Christopher Schultz:
> So, removing the trailing space in the "class" attribute's value?

That too - but have a look at:

mrf-mmrf-image

it was before / should be:

mrf-m mrf-image

there are missing whitespaces in the actual class attributes content.

Torsten


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: trimSpaces removing whitespace from html

David Kavanagh
Yes, the problem happens in the class attribute string.
They are some examples but it happened throughout the files in many cases.

I am using .jsp files

Also, in the second example that i gave, you can see that mrf-video was
removed as well as mrf-m and mrf-image being joined.
This was the strangest one to me, and it only happened once in the file.


On 11 May 2017 at 15:33, Torsten Krah <[hidden email]> wrote:

> Am Donnerstag, den 11.05.2017, 09:23 -0400 schrieb Christopher Schultz:
> > So, removing the trailing space in the "class" attribute's value?
>
> That too - but have a look at:
>
> mrf-mmrf-image
>
> it was before / should be:
>
> mrf-m mrf-image
>
> there are missing whitespaces in the actual class attributes content.
>
> Torsten
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: trimSpaces removing whitespace from html

Mark Thomas-2
On 11 May 2017 15:34:32 BST, David Kavanagh <[hidden email]> wrote:

>Yes, the problem happens in the class attribute string.
>They are some examples but it happened throughout the files in many
>cases.
>
>I am using .jsp files
>
>Also, in the second example that i gave, you can see that mrf-video was
>removed as well as mrf-m and mrf-image being joined.
>This was the strangest one to me, and it only happened once in the
>file.
>
>
>On 11 May 2017 at 15:33, Torsten Krah <[hidden email]> wrote:
>
>> Am Donnerstag, den 11.05.2017, 09:23 -0400 schrieb Christopher
>Schultz:
>> > So, removing the trailing space in the "class" attribute's value?
>>
>> That too - but have a look at:
>>
>> mrf-mmrf-image
>>
>> it was before / should be:
>>
>> mrf-m mrf-image
>>
>> there are missing whitespaces in the actual class attributes content.
>>
>> Torsten
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>

Can you provide the simplest JSP that reproduces this issue?

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: trimSpaces removing whitespace from html

David Kavanagh
Yes, this is one of the .jsp files. I don't know how useful this is.
Has anyone heard of a similar issue using trimSpaces before, or do you
think this might be something to do with the particular files being used?

Thanks

<%@taglib prefix="dali" uri="http://dev.marfeel.com/jsp/mrf/dali" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%@page pageEncoding="UTF-8" %>

<c:set var="buttonType" value="OPACITYLIGHT" scope="request" />
<dali:article layoutClasses="mrf-article mrf-article--author"
              imageClass="l"
              size="xs"
              layout="${layout}"
              defaultLayoutName="author"
              item="${currentItem}"
              articleTemplate="articleTemplates/author.jsp"
              extended="false"/>

On 11 May 2017 at 18:35, Mark Thomas <[hidden email]> wrote:

> On 11 May 2017 15:34:32 BST, David Kavanagh <[hidden email]>
> wrote:
> >Yes, the problem happens in the class attribute string.
> >They are some examples but it happened throughout the files in many
> >cases.
> >
> >I am using .jsp files
> >
> >Also, in the second example that i gave, you can see that mrf-video was
> >removed as well as mrf-m and mrf-image being joined.
> >This was the strangest one to me, and it only happened once in the
> >file.
> >
> >
> >On 11 May 2017 at 15:33, Torsten Krah <[hidden email]> wrote:
> >
> >> Am Donnerstag, den 11.05.2017, 09:23 -0400 schrieb Christopher
> >Schultz:
> >> > So, removing the trailing space in the "class" attribute's value?
> >>
> >> That too - but have a look at:
> >>
> >> mrf-mmrf-image
> >>
> >> it was before / should be:
> >>
> >> mrf-m mrf-image
> >>
> >> there are missing whitespaces in the actual class attributes content.
> >>
> >> Torsten
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [hidden email]
> >> For additional commands, e-mail: [hidden email]
> >>
> >>
>
> Can you provide the simplest JSP that reproduces this issue?
>
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: trimSpaces removing whitespace from html

Mark Thomas-2
On 12/05/17 17:08, David Kavanagh wrote:
> Yes, this is one of the .jsp files. I don't know how useful this is.

Hopefully this will reproduce this. Looking at this is on my TODO list
while I'm at ApacheCon.

> Has anyone heard of a similar issue using trimSpaces before, or do you
> think this might be something to do with the particular files being used?

This isn't anything I recall seeing before. The parsing is all handled
by the JRE. While historically the XML parsing provided by the JRE was
fairly buggy, these days it is much better. One thing on my TODO list is
to check the XML specs to make sure that any required escaping is not
missing or something along those lines.



>
> Thanks
>
> <%@taglib prefix="dali" uri="http://dev.marfeel.com/jsp/mrf/dali" %>
> <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
>
> <%@page pageEncoding="UTF-8" %>
>
> <c:set var="buttonType" value="OPACITYLIGHT" scope="request" />
> <dali:article layoutClasses="mrf-article mrf-article--author"
>               imageClass="l"
>               size="xs"
>               layout="${layout}"
>               defaultLayoutName="author"
>               item="${currentItem}"
>               articleTemplate="articleTemplates/author.jsp"
>               extended="false"/>
>
> On 11 May 2017 at 18:35, Mark Thomas <[hidden email]> wrote:
>
>> On 11 May 2017 15:34:32 BST, David Kavanagh <[hidden email]>
>> wrote:
>>> Yes, the problem happens in the class attribute string.
>>> They are some examples but it happened throughout the files in many
>>> cases.
>>>
>>> I am using .jsp files
>>>
>>> Also, in the second example that i gave, you can see that mrf-video was
>>> removed as well as mrf-m and mrf-image being joined.
>>> This was the strangest one to me, and it only happened once in the
>>> file.
>>>
>>>
>>> On 11 May 2017 at 15:33, Torsten Krah <[hidden email]> wrote:
>>>
>>>> Am Donnerstag, den 11.05.2017, 09:23 -0400 schrieb Christopher
>>> Schultz:
>>>>> So, removing the trailing space in the "class" attribute's value?
>>>>
>>>> That too - but have a look at:
>>>>
>>>> mrf-mmrf-image
>>>>
>>>> it was before / should be:
>>>>
>>>> mrf-m mrf-image
>>>>
>>>> there are missing whitespaces in the actual class attributes content.
>>>>
>>>> Torsten
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>>>
>>
>> Can you provide the simplest JSP that reproduces this issue?
>>
>> Mark
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: trimSpaces removing whitespace from html

David Kavanagh
Ok cool, hopefully that will reproduce so you can see for yourself.
Thanks!

On 15 May 2017 at 10:39, Mark Thomas <[hidden email]> wrote:

> On 12/05/17 17:08, David Kavanagh wrote:
> > Yes, this is one of the .jsp files. I don't know how useful this is.
>
> Hopefully this will reproduce this. Looking at this is on my TODO list
> while I'm at ApacheCon.
>
> > Has anyone heard of a similar issue using trimSpaces before, or do you
> > think this might be something to do with the particular files being used?
>
> This isn't anything I recall seeing before. The parsing is all handled
> by the JRE. While historically the XML parsing provided by the JRE was
> fairly buggy, these days it is much better. One thing on my TODO list is
> to check the XML specs to make sure that any required escaping is not
> missing or something along those lines.
>
>
>
> >
> > Thanks
> >
> > <%@taglib prefix="dali" uri="http://dev.marfeel.com/jsp/mrf/dali" %>
> > <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
> >
> > <%@page pageEncoding="UTF-8" %>
> >
> > <c:set var="buttonType" value="OPACITYLIGHT" scope="request" />
> > <dali:article layoutClasses="mrf-article mrf-article--author"
> >               imageClass="l"
> >               size="xs"
> >               layout="${layout}"
> >               defaultLayoutName="author"
> >               item="${currentItem}"
> >               articleTemplate="articleTemplates/author.jsp"
> >               extended="false"/>
> >
> > On 11 May 2017 at 18:35, Mark Thomas <[hidden email]> wrote:
> >
> >> On 11 May 2017 15:34:32 BST, David Kavanagh <[hidden email]
> >
> >> wrote:
> >>> Yes, the problem happens in the class attribute string.
> >>> They are some examples but it happened throughout the files in many
> >>> cases.
> >>>
> >>> I am using .jsp files
> >>>
> >>> Also, in the second example that i gave, you can see that mrf-video was
> >>> removed as well as mrf-m and mrf-image being joined.
> >>> This was the strangest one to me, and it only happened once in the
> >>> file.
> >>>
> >>>
> >>> On 11 May 2017 at 15:33, Torsten Krah <[hidden email]> wrote:
> >>>
> >>>> Am Donnerstag, den 11.05.2017, 09:23 -0400 schrieb Christopher
> >>> Schultz:
> >>>>> So, removing the trailing space in the "class" attribute's value?
> >>>>
> >>>> That too - but have a look at:
> >>>>
> >>>> mrf-mmrf-image
> >>>>
> >>>> it was before / should be:
> >>>>
> >>>> mrf-m mrf-image
> >>>>
> >>>> there are missing whitespaces in the actual class attributes content.
> >>>>
> >>>> Torsten
> >>>>
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: [hidden email]
> >>>> For additional commands, e-mail: [hidden email]
> >>>>
> >>>>
> >>
> >> Can you provide the simplest JSP that reproduces this issue?
> >>
> >> Mark
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [hidden email]
> >> For additional commands, e-mail: [hidden email]
> >>
> >>
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: trimSpaces removing whitespace from html

Mark Thomas-2
On 15/05/2017 10:29, David Kavanagh wrote:
> Ok cool, hopefully that will reproduce so you can see for yourself.
> Thanks!

I've done the best I can to reproduce this without the access to the
commerical tag library you appear to be using without success.

I've also checked the trimSpaces implementation and I can't see how an
attribute value could be corrupted.

At this point I'm inclined to think this is not a Tomcat problem. If you
can provide a simple test case (e.g JSP and tag file) that can be
dropped into Tomcat to demonstrate this problem then I'd be happy to
look at this further.

Mark



>
> On 15 May 2017 at 10:39, Mark Thomas <[hidden email]> wrote:
>
>> On 12/05/17 17:08, David Kavanagh wrote:
>>> Yes, this is one of the .jsp files. I don't know how useful this is.
>>
>> Hopefully this will reproduce this. Looking at this is on my TODO list
>> while I'm at ApacheCon.
>>
>>> Has anyone heard of a similar issue using trimSpaces before, or do you
>>> think this might be something to do with the particular files being used?
>>
>> This isn't anything I recall seeing before. The parsing is all handled
>> by the JRE. While historically the XML parsing provided by the JRE was
>> fairly buggy, these days it is much better. One thing on my TODO list is
>> to check the XML specs to make sure that any required escaping is not
>> missing or something along those lines.
>>
>>
>>
>>>
>>> Thanks
>>>
>>> <%@taglib prefix="dali" uri="http://dev.marfeel.com/jsp/mrf/dali" %>
>>> <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
>>>
>>> <%@page pageEncoding="UTF-8" %>
>>>
>>> <c:set var="buttonType" value="OPACITYLIGHT" scope="request" />
>>> <dali:article layoutClasses="mrf-article mrf-article--author"
>>>                imageClass="l"
>>>                size="xs"
>>>                layout="${layout}"
>>>                defaultLayoutName="author"
>>>                item="${currentItem}"
>>>                articleTemplate="articleTemplates/author.jsp"
>>>                extended="false"/>
>>>
>>> On 11 May 2017 at 18:35, Mark Thomas <[hidden email]> wrote:
>>>
>>>> On 11 May 2017 15:34:32 BST, David Kavanagh <[hidden email]
>>>
>>>> wrote:
>>>>> Yes, the problem happens in the class attribute string.
>>>>> They are some examples but it happened throughout the files in many
>>>>> cases.
>>>>>
>>>>> I am using .jsp files
>>>>>
>>>>> Also, in the second example that i gave, you can see that mrf-video was
>>>>> removed as well as mrf-m and mrf-image being joined.
>>>>> This was the strangest one to me, and it only happened once in the
>>>>> file.
>>>>>
>>>>>
>>>>> On 11 May 2017 at 15:33, Torsten Krah <[hidden email]> wrote:
>>>>>
>>>>>> Am Donnerstag, den 11.05.2017, 09:23 -0400 schrieb Christopher
>>>>> Schultz:
>>>>>>> So, removing the trailing space in the "class" attribute's value?
>>>>>>
>>>>>> That too - but have a look at:
>>>>>>
>>>>>> mrf-mmrf-image
>>>>>>
>>>>>> it was before / should be:
>>>>>>
>>>>>> mrf-m mrf-image
>>>>>>
>>>>>> there are missing whitespaces in the actual class attributes content.
>>>>>>
>>>>>> Torsten
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: [hidden email]
>>>>>> For additional commands, e-mail: [hidden email]
>>>>>>
>>>>>>
>>>>
>>>> Can you provide the simplest JSP that reproduces this issue?
>>>>
>>>> Mark
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: trimSpaces removing whitespace from html

David Kavanagh
Hi Mark,

Apologies for the delay. I have the files that should reproduce the error for you. 
The imageTopWrapper.jsp loads the articleBody.tag. Then inside the articleBody.tag file the following
section loads class names into the class attributes. 

<article data-mrf-article="${section.name}${fn:length(item.uri) == 0 ? item.id : item.detailItem.id}"
data-mrf-section="${section.name}"
data-mrf-section-title="${section.title}"
data-mrf-sectionId="${linkedItem == null ? section.name : 'articleLink'}"
data-mrf-extracted="${item.isExtracted()}"
data-mrf-uri="${item.uri}"
data-mrf-layout="${layout}#${position}"
data-mrf-headline="${headline}"
data-shortcut="navigationLevel:open:details"
<c:if test="${not avoidTransitioner}">data-mrf-transitioner="${transitioner}"</c:if>
<c:if test="${not empty virtualPageId}">data-mrf-virtualpageid="${virtualPageId}"</c:if>
class="${articleClass} ${imageClassName} ${pocketClassName}">
This is the correct output when the trimSpaces flag is not enabled.

class="mrf-article mrf-article--photo mrf-page mrf-noFillet mrf-author mrf-m mrf-image ">

This is the output after it is enabled

class="mrf-article mrf-article--photo mrf-page mrf-noFillet mrf-author mrf-mmrf-image">

I have attached the two necessary files.
Hopefully this can reproduce the error for you

Thanks


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: trimSpaces removing whitespace from html

Christopher Schultz-2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

David,

Your attachments were stripped from the list. Can you put the text
directly into your post?

Thanks,
- -chris

On 5/24/17 6:29 AM, David Kavanagh wrote:

> Hi Mark,
>
> Apologies for the delay. I have the files that should reproduce
> the error for you. The imageTopWrapper.jsp loads the
> articleBody.tag. Then inside the articleBody.tag file the
> following section loads class names into the class attributes.
>
> <article data-mrf-article="${section.name
> <http://section.name>}${fn:length(item.uri) == 0 ? item.id
> <http://item.id> : item.detailItem.id
> <http://item.detailItem.id>}" data-mrf-section="${section.name
> <http://section.name>}" data-mrf-section-title="${section.title}"
> data-mrf-sectionId="${linkedItem == null ? section.name
> <http://section.name> : 'articleLink'}"
> data-mrf-extracted="${item.isExtracted()}"
> data-mrf-uri="${item.uri}" data-mrf-layout="${layout}#${position}"
> data-mrf-headline="${headline}"
> data-shortcut="navigationLevel:open:details" <c:if test="${not
> avoidTransitioner}">data-mrf-transitioner="${transitioner}"</c:if>
> <c:if test="${not empty
> virtualPageId}">data-mrf-virtualpageid="${virtualPageId}"</c:if>
> class="${articleClass}${imageClassName}${pocketClassName}">
>
> This is the correct output when the trimSpaces flag is not
> enabled.
>
> class="mrf-article mrf-article--photo mrf-page mrf-noFillet
> mrf-author mrf-m mrf-image ">
>
>
> This is the output after it is enabled
>
> class="mrf-article mrf-article--photo mrf-page mrf-noFillet
> mrf-author mrf-mmrf-image">
>
>
> I have attached the two necessary files. Hopefully this can
> reproduce the error for you
>
> Thanks
>
>
>
> ---------------------------------------------------------------------
>
>
To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJZJZZMAAoJEBzwKT+lPKRYXpYP/3ZS4M7eaZ+/13kY09RWe1cP
m9THOTZxZNOuv/8FV5Zysdy1c2c1FWAyyS/JfIt0k2j6mDiEYOi9zjR1Bcrue05Z
sI1UHUeFK4t+uPEQiXmz0NPrH+1Wj/d3QqbZrdhmZ6EJBFf5vZTWeft6ynX1Gjpc
EV20DMMYjblsStwF1NTflJxbWBXkvYD8Kj8CzKpfExZF73AZdpxcScSjXsky3+4V
W2Gm2LkQ9tKBa4Zzz8p0DCt1iHCMb8qUVHWd6zoLW10NcScwTHhd/uSj1ZVqMNv5
P0K0Vvw8tSZ5/TuVnZZeSZgIlhsNwX2JAoIjiqrid0bn0IEM54k5ULZnq7+fBoZP
eeAMybADTZhgjUqOjeKarV5GK3uGTkGble0LVq5NFETTwd3eZIwTij1Xd7YHhPPq
uK44R9GzhWwI+k7CNUMU3l4SXDLBaFklCHevfw+ibpW1tP3hvXMLOiTD23gG9xHS
pn7cjLKps7ovR0WeYFLwLtzFSW6GjlUdU1nvRqIeg0+RpcVI/BZvOvaneuKGKgan
MLUayvdNwhY3b29d7i0e2zV8hVAD7LSTVDlMeLjOfvftuxgPXBrUagQktHjr/6tA
l11RjI86F0TbWX/ZSFvrKfpBkp7OpIsC/ayuovm4bWosCIIK8HzUc3GQUc1G34yD
IyerNligTd2KezQytipB
=uh7o
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: trimSpaces removing whitespace from html

David Kavanagh
Hey guys,

Thanks for getting back to me. I didn't realise that the attachments would
be stripped.

Here are the two files in full.

The first is the imageTopWrapper.js

<%@taglib prefix="hint" tagdir="/WEB-INF/tags/vhosts/marfeel/tags/hint" %>
<%@ page import="com.marfeel.dali.tags.SummaryTagStrategy" %>

<hint:articleBody forceBigImage="true">
    <hint:articleImage size="BIG" backgroundStyle="horizontal"/>

    <hint:articleShare />

    <div class="mrf-articleText">
        <hint:premiumWrapper>
            <hint:articleHeadlines author="true" date="true"/>

            <hint:articleSummary extended="${extended}"
strategy="<%=SummaryTagStrategy.MOSAIC%>">
                <hint:articleImage size="SMALL"
backgroundStyle="horizontal"/>
            </hint:articleSummary>
        </hint:premiumWrapper>
    </div>
</hint:articleBody>




And here is the second file, the tag file artileBody.tag




<%--
  ~ Copyright (c) 2013 by Marfeel Solutions (http://www.marfeel.com)
  ~ All Rights Reserved.
  ~
  ~ NOTICE:  All information contained herein is, and remains
  ~ the property of Marfeel Solutions S.L and its suppliers,
  ~ if any.  The intellectual and technical concepts contained
  ~ herein are proprietary to Marfeel Solutions S.L and its
  ~ suppliers and are protected by trade secret or copyright law.
  ~ Dissemination of this information or reproduction of this material
  ~ is strictly forbidden unless prior written permission is obtained
  ~ from Marfeel Solutions SL.
  --%>

<%@attribute name="alwaysImage" required="false" type="java.lang.Boolean" %>
<%@attribute name="forceBigImage" required="false" type="java.lang.Boolean"
%>
<%@attribute name="mediaSelectorStrategy" required="false"
type="java.lang.String"%>

<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="dali" uri="http://dev.marfeel.com/jsp/mrf/dali" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@taglib prefix="hint" tagdir="/WEB-INF/tags/vhosts/marfeel/tags/hint" %>
<%@taglib prefix="ui" tagdir="/WEB-INF/tags/vhosts/marfeel/tags/ui" %>

<c:set var="imageType" value="NONE" scope="request"/>
<c:set var="contentImg" value="" scope="request"/>
<c:set var="imageClassName" value="" scope="request"/>
<c:set var="pocketClassName" value="" scope="request"/>
<c:set var="avoidTransitioner" value="${not empty param.marfeelContext and
param.marfeelContext == 's_d' and theme.name == 'k'}" scope="request" />

<c:choose>
    <c:when test="${not empty
uIFeatures.get('defaultMediaSelectorStrategy')}">
        <c:set var="defaultMediaSelectorStrategy"
value="${uIFeatures.get('defaultMediaSelectorStrategy')}"/>
    </c:when>

    <c:otherwise>
        <c:set var="defaultMediaSelectorStrategy" value='HINT_OR_DETAIL'/>
    </c:otherwise>
</c:choose>

<dali:mediaSelector item="${item}" var="media" strategy="${(empty
mediaSelectorStrategy) ? defaultMediaSelectorStrategy :
mediaSelectorStrategy}" articleSize="${size}">
    <c:set var="contentImg" value="${media.src}" scope="request"/>

    <c:set var="imageClassName" value="mrf-image" scope="request"/>
    <c:set var="imageType" value="BIG" scope="request"/>

    <c:if test="${!forceBigImage && media.width < 200}">
        <c:set var="imageType" value="SMALL" scope="request"/>
        <c:set var="imageClassName" value="" scope="request"/>
    </c:if>
</dali:mediaSelector>

<c:if test="${alwaysImage}">
    <c:set var="imageClassName" value="mrf-image" scope="request"/>
    <c:set var="imageType" value="BIG" scope="request"/>
</c:if>

<c:if test="${item.pocket != null}">
    <c:set var="pocketClassName" value="${item.pocket.className}"
scope="request"/>
</c:if>

<c:choose>
    <c:when test="${not empty item.detailItem}">
        <c:set var="headline"
value="${fn:escapeXml(item.detailItem.getTitle())}"/>
    </c:when>
    <c:otherwise>
        <c:set var="headline" value="${fn:escapeXml(item.getPageTitle())}"/>
    </c:otherwise>
</c:choose>

<c:if test="${not empty forcePhotoArticle &&
                not fn:contains(articleClass, 'mrf-photoArticle')}">
    <c:set var="articleClass" value="${articleClass} mrf-photoArticle"
scope="request"/>
</c:if>

<article data-mrf-article="${section.name}${fn:length(item.uri) == 0 ?
item.id : item.detailItem.id}"
         data-mrf-section="${section.name}"
data-mrf-section-title="${section.title}"
         data-mrf-sectionId="${linkedItem == null ? section.name :
'articleLink'}"
         data-mrf-extracted="${item.isExtracted()}"
         data-mrf-uri="${item.uri}"
         data-mrf-layout="${layout}#${position}"
         data-mrf-headline="${headline}"
         data-shortcut="navigationLevel:open:details"
<c:if test="${not
avoidTransitioner}">data-mrf-transitioner="${transitioner}"</c:if>
         <c:if test="${not empty
virtualPageId}">data-mrf-virtualpageid="${virtualPageId}"</c:if>
         class="${articleClass} ${imageClassName} ${pocketClassName}">

    <c:choose>
        <c:when test="${not empty buttonType}">
            <ui:button type="${buttonType}" url="${item.uri}"
buttonClass="mrf-buttonArticle mrf-hidden-link ${not empty buttonClass ?
buttonClass : ''}">
                <jsp:doBody />
            </ui:button>
        </c:when>
        <c:otherwise>
            <jsp:doBody />
        </c:otherwise>
    </c:choose>

</article>




Thanks again for the help. Its really appreciated.

Kind Regards

David

On 24 May 2017 at 16:18, Christopher Schultz <[hidden email]>
wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> David,
>
> Your attachments were stripped from the list. Can you put the text
> directly into your post?
>
> Thanks,
> - -chris
>
> On 5/24/17 6:29 AM, David Kavanagh wrote:
> > Hi Mark,
> >
> > Apologies for the delay. I have the files that should reproduce
> > the error for you. The imageTopWrapper.jsp loads the
> > articleBody.tag. Then inside the articleBody.tag file the
> > following section loads class names into the class attributes.
> >
> > <article data-mrf-article="${section.name
> > <http://section.name>}${fn:length(item.uri) == 0 ? item.id
> > <http://item.id> : item.detailItem.id
> > <http://item.detailItem.id>}" data-mrf-section="${section.name
> > <http://section.name>}" data-mrf-section-title="${section.title}"
> > data-mrf-sectionId="${linkedItem == null ? section.name
> > <http://section.name> : 'articleLink'}"
> > data-mrf-extracted="${item.isExtracted()}"
> > data-mrf-uri="${item.uri}" data-mrf-layout="${layout}#${position}"
> > data-mrf-headline="${headline}"
> > data-shortcut="navigationLevel:open:details" <c:if test="${not
> > avoidTransitioner}">data-mrf-transitioner="${transitioner}"</c:if>
> > <c:if test="${not empty
> > virtualPageId}">data-mrf-virtualpageid="${virtualPageId}"</c:if>
> > class="${articleClass}${imageClassName}${pocketClassName}">
> >
> > This is the correct output when the trimSpaces flag is not
> > enabled.
> >
> > class="mrf-article mrf-article--photo mrf-page mrf-noFillet
> > mrf-author mrf-m mrf-image ">
> >
> >
> > This is the output after it is enabled
> >
> > class="mrf-article mrf-article--photo mrf-page mrf-noFillet
> > mrf-author mrf-mmrf-image">
> >
> >
> > I have attached the two necessary files. Hopefully this can
> > reproduce the error for you
> >
> > Thanks
> >
> >
> >
> > ---------------------------------------------------------------------
> >
> >
> To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> -----BEGIN PGP SIGNATURE-----
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJZJZZMAAoJEBzwKT+lPKRYXpYP/3ZS4M7eaZ+/13kY09RWe1cP
> m9THOTZxZNOuv/8FV5Zysdy1c2c1FWAyyS/JfIt0k2j6mDiEYOi9zjR1Bcrue05Z
> sI1UHUeFK4t+uPEQiXmz0NPrH+1Wj/d3QqbZrdhmZ6EJBFf5vZTWeft6ynX1Gjpc
> EV20DMMYjblsStwF1NTflJxbWBXkvYD8Kj8CzKpfExZF73AZdpxcScSjXsky3+4V
> W2Gm2LkQ9tKBa4Zzz8p0DCt1iHCMb8qUVHWd6zoLW10NcScwTHhd/uSj1ZVqMNv5
> P0K0Vvw8tSZ5/TuVnZZeSZgIlhsNwX2JAoIjiqrid0bn0IEM54k5ULZnq7+fBoZP
> eeAMybADTZhgjUqOjeKarV5GK3uGTkGble0LVq5NFETTwd3eZIwTij1Xd7YHhPPq
> uK44R9GzhWwI+k7CNUMU3l4SXDLBaFklCHevfw+ibpW1tP3hvXMLOiTD23gG9xHS
> pn7cjLKps7ovR0WeYFLwLtzFSW6GjlUdU1nvRqIeg0+RpcVI/BZvOvaneuKGKgan
> MLUayvdNwhY3b29d7i0e2zV8hVAD7LSTVDlMeLjOfvftuxgPXBrUagQktHjr/6tA
> l11RjI86F0TbWX/ZSFvrKfpBkp7OpIsC/ayuovm4bWosCIIK8HzUc3GQUc1G34yD
> IyerNligTd2KezQytipB
> =uh7o
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: trimSpaces removing whitespace from html

Mark Thomas-2
On 26/05/17 10:15, David Kavanagh wrote:
> Hey guys,
>
> Thanks for getting back to me. I didn't realise that the attachments would
> be stripped.>
> Here are the two files in full.

That isn't enough for us to reproduce it. Those files refer to a handful
of other tag files and classes we don't have.

However, I have been able to derive a simple test case from it:

=====start======
<p class="${'foo'} ${'bar'}">This is a test</p>
======end=======

The output with trimSpaces enabled is:

=====start======
<p class="foobar">This is a test</p>
======end=======

trimSpaces is behaving exactly as designed. It removes any blocks of
template text that consist solely of white space.

What you have is:
TemplateText [<p class="]
Expression   [${'foo'}]
TemplateText [ ]
Expression   [${'bar'}]
TemplateText [">This is a test</p>]

Because the second template text is empty, it gets removed.

The fix is:

=====start======
<p class="${'foo'}${' '}${'bar'}">This is a test</p>
======end=======

This is a potential use case for a recently closed (as WONTFIX)
enhancement request:

https://bz.apache.org/bugzilla/show_bug.cgi?id=45931

Whether this use case is sufficient to justify re-opening that
enhancement request, reviewing the patch and updating it for 9.0.x is
TBD. How realistic is it for you to apply the fix (using ${' '})
described above?

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: trimSpaces removing whitespace from html

David Kavanagh
Thanks Mark,

I will try that out and let you know if it sorts our issue.

Much appreciated

On 26 May 2017 at 12:59, Mark Thomas <[hidden email]> wrote:

> On 26/05/17 10:15, David Kavanagh wrote:
> > Hey guys,
> >
> > Thanks for getting back to me. I didn't realise that the attachments
> would
> > be stripped.>
> > Here are the two files in full.
>
> That isn't enough for us to reproduce it. Those files refer to a handful
> of other tag files and classes we don't have.
>
> However, I have been able to derive a simple test case from it:
>
> =====start======
> <p class="${'foo'} ${'bar'}">This is a test</p>
> ======end=======
>
> The output with trimSpaces enabled is:
>
> =====start======
> <p class="foobar">This is a test</p>
> ======end=======
>
> trimSpaces is behaving exactly as designed. It removes any blocks of
> template text that consist solely of white space.
>
> What you have is:
> TemplateText [<p class="]
> Expression   [${'foo'}]
> TemplateText [ ]
> Expression   [${'bar'}]
> TemplateText [">This is a test</p>]
>
> Because the second template text is empty, it gets removed.
>
> The fix is:
>
> =====start======
> <p class="${'foo'}${' '}${'bar'}">This is a test</p>
> ======end=======
>
> This is a potential use case for a recently closed (as WONTFIX)
> enhancement request:
>
> https://bz.apache.org/bugzilla/show_bug.cgi?id=45931
>
> Whether this use case is sufficient to justify re-opening that
> enhancement request, reviewing the patch and updating it for 9.0.x is
> TBD. How realistic is it for you to apply the fix (using ${' '})
> described above?
>
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: trimSpaces removing whitespace from html

David Kavanagh
I will need to confirm with some people if that is a realistic fix for us
and i will let you know.

Thanks

On 26 May 2017 at 13:05, David Kavanagh <[hidden email]> wrote:

> Thanks Mark,
>
> I will try that out and let you know if it sorts our issue.
>
> Much appreciated
>
> On 26 May 2017 at 12:59, Mark Thomas <[hidden email]> wrote:
>
>> On 26/05/17 10:15, David Kavanagh wrote:
>> > Hey guys,
>> >
>> > Thanks for getting back to me. I didn't realise that the attachments
>> would
>> > be stripped.>
>> > Here are the two files in full.
>>
>> That isn't enough for us to reproduce it. Those files refer to a handful
>> of other tag files and classes we don't have.
>>
>> However, I have been able to derive a simple test case from it:
>>
>> =====start======
>> <p class="${'foo'} ${'bar'}">This is a test</p>
>> ======end=======
>>
>> The output with trimSpaces enabled is:
>>
>> =====start======
>> <p class="foobar">This is a test</p>
>> ======end=======
>>
>> trimSpaces is behaving exactly as designed. It removes any blocks of
>> template text that consist solely of white space.
>>
>> What you have is:
>> TemplateText [<p class="]
>> Expression   [${'foo'}]
>> TemplateText [ ]
>> Expression   [${'bar'}]
>> TemplateText [">This is a test</p>]
>>
>> Because the second template text is empty, it gets removed.
>>
>> The fix is:
>>
>> =====start======
>> <p class="${'foo'}${' '}${'bar'}">This is a test</p>
>> ======end=======
>>
>> This is a potential use case for a recently closed (as WONTFIX)
>> enhancement request:
>>
>> https://bz.apache.org/bugzilla/show_bug.cgi?id=45931
>>
>> Whether this use case is sufficient to justify re-opening that
>> enhancement request, reviewing the patch and updating it for 9.0.x is
>> TBD. How realistic is it for you to apply the fix (using ${' '})
>> described above?
>>
>> Mark
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: trimSpaces removing whitespace from html

Christopher Schultz-2
In reply to this post by Mark Thomas-2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Mark,

On 5/26/17 6:59 AM, Mark Thomas wrote:

> On 26/05/17 10:15, David Kavanagh wrote:
>> Hey guys,
>>
>> Thanks for getting back to me. I didn't realise that the
>> attachments would be stripped.> Here are the two files in full.
>
> That isn't enough for us to reproduce it. Those files refer to a
> handful of other tag files and classes we don't have.
>
> However, I have been able to derive a simple test case from it:
>
> =====start====== <p class="${'foo'} ${'bar'}">This is a test</p>
> ======end=======
>
> The output with trimSpaces enabled is:
>
> =====start====== <p class="foobar">This is a test</p>
> ======end=======
>
> trimSpaces is behaving exactly as designed. It removes any blocks
> of template text that consist solely of white space.
>
> What you have is: TemplateText [<p class="] Expression
> [${'foo'}] TemplateText [ ] Expression   [${'bar'}] TemplateText
> [">This is a test</p>]
>
> Because the second template text is empty, it gets removed.
>
> The fix is:
>
> =====start====== <p class="${'foo'}${' '}${'bar'}">This is a
> test</p> ======end=======
>
> This is a potential use case for a recently closed (as WONTFIX)
> enhancement request:
>
> https://bz.apache.org/bugzilla/show_bug.cgi?id=45931
>
> Whether this use case is sufficient to justify re-opening that
> enhancement request, reviewing the patch and updating it for 9.0.x
> is TBD. How realistic is it for you to apply the fix (using ${'
> '}) described above?

Would it be reasonable to change trimSpaces so that spaces within
element attributes would be normalized to a single space, and others
would be removed? I'm not sure how aware the parser is of the
surrounding document structure.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlkokS8ACgkQHPApP6U8
pFiW1A/+LnfMx+8SfU0TkGuhfxiKxh4kfdX+Hn4XNjJbcyAqTuPnwBD3D1kfXB6r
QajDBPlEj9vKQgRZhdEuYpj/fMRxqxrdcwMR0ImjWhb4dm7q6ZxsDnWdWqzI3GF+
ltYQ4Oql+NmCLkXMxZOF6JMUVJGWcj+wQnCuwWp5UvRzFhZTzevcz9H+35TPPa3z
t+oX2ZjnAPXXVI+C8fnJ5qrdm6Ovj853BzQteR40vB6zwk8CDkyWhN98XEBz1DrD
QMQTXe0VHa6B0cgrrNLna6K3S5FwolnQJS6xA2AKHMR8ugoAukBGJjBHntAo9NAH
XvR+5Wxx/Iecc/9Cw/YuKgFzExEKQvU7Nj9EhuUrTIDKVGYMEG8rg2iEkRtqjd8T
sQptiIt/kHoRSsatfSP1RzqhTVsbOJrATEQdoas5Tzn0rSKwXZkGPe7iHH/hHAlI
EREd25F6zHHKJL6Vugw7UidRtqIg8htg2EwhgDstx/gw334L9xB//KnrMWM+ErDf
gZkEPrE2tXzeu7hkDvpWVxERN9mMx6UT7uEUgG7csTBdKPh2snBBhJzSsKX2GyS6
/OPXwzfFdD526rI5ZgzSzGbuC4Z1TAHjtBBnLWsstIjZtIRq+SKFGl15gfNxj0PQ
KYc9uvoduFfUspT7eRaEk1DbkUBidA/sfhmPMgove3XVq+u5/SM=
=gYLg
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: trimSpaces removing whitespace from html

David Kavanagh
On 26 May 2017 at 22:33, Christopher Schultz <[hidden email]>
wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Mark,
>
> On 5/26/17 6:59 AM, Mark Thomas wrote:
> > On 26/05/17 10:15, David Kavanagh wrote:
> >> Hey guys,
> >>
> >> Thanks for getting back to me. I didn't realise that the
> >> attachments would be stripped.> Here are the two files in full.
> >
> > That isn't enough for us to reproduce it. Those files refer to a
> > handful of other tag files and classes we don't have.
> >
> > However, I have been able to derive a simple test case from it:
> >
> > =====start====== <p class="${'foo'} ${'bar'}">This is a test</p>
> > ======end=======
> >
> > The output with trimSpaces enabled is:
> >
> > =====start====== <p class="foobar">This is a test</p>
> > ======end=======
> >
> > trimSpaces is behaving exactly as designed. It removes any blocks
> > of template text that consist solely of white space.
> >
> > What you have is: TemplateText [<p class="] Expression
> > [${'foo'}] TemplateText [ ] Expression   [${'bar'}] TemplateText
> > [">This is a test</p>]
> >
> > Because the second template text is empty, it gets removed.
> >
> > The fix is:
> >
> > =====start====== <p class="${'foo'}${' '}${'bar'}">This is a
> > test</p> ======end=======
> >
> > This is a potential use case for a recently closed (as WONTFIX)
> > enhancement request:
> >
> > https://bz.apache.org/bugzilla/show_bug.cgi?id=45931
> >
> > Whether this use case is sufficient to justify re-opening that
> > enhancement request, reviewing the patch and updating it for 9.0.x
> > is TBD. How realistic is it for you to apply the fix (using ${'
> > '}) described above?
>
> Would it be reasonable to change trimSpaces so that spaces within
> element attributes would be normalized to a single space, and others
> would be removed? I'm not sure how aware the parser is of the
> surrounding document structure.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlkokS8ACgkQHPApP6U8
> pFiW1A/+LnfMx+8SfU0TkGuhfxiKxh4kfdX+Hn4XNjJbcyAqTuPnwBD3D1kfXB6r
> QajDBPlEj9vKQgRZhdEuYpj/fMRxqxrdcwMR0ImjWhb4dm7q6ZxsDnWdWqzI3GF+
> ltYQ4Oql+NmCLkXMxZOF6JMUVJGWcj+wQnCuwWp5UvRzFhZTzevcz9H+35TPPa3z
> t+oX2ZjnAPXXVI+C8fnJ5qrdm6Ovj853BzQteR40vB6zwk8CDkyWhN98XEBz1DrD
> QMQTXe0VHa6B0cgrrNLna6K3S5FwolnQJS6xA2AKHMR8ugoAukBGJjBHntAo9NAH
> XvR+5Wxx/Iecc/9Cw/YuKgFzExEKQvU7Nj9EhuUrTIDKVGYMEG8rg2iEkRtqjd8T
> sQptiIt/kHoRSsatfSP1RzqhTVsbOJrATEQdoas5Tzn0rSKwXZkGPe7iHH/hHAlI
> EREd25F6zHHKJL6Vugw7UidRtqIg8htg2EwhgDstx/gw334L9xB//KnrMWM+ErDf
> gZkEPrE2tXzeu7hkDvpWVxERN9mMx6UT7uEUgG7csTBdKPh2snBBhJzSsKX2GyS6
> /OPXwzfFdD526rI5ZgzSzGbuC4Z1TAHjtBBnLWsstIjZtIRq+SKFGl15gfNxj0PQ
> KYc9uvoduFfUspT7eRaEk1DbkUBidA/sfhmPMgove3XVq+u5/SM=
> =gYLg
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

Hey guys,

Thanks again for the help. For the Tomcat setup we currently have, the
first link sent my Mark is a good fix for us.
The other option Mark posted that would require modifying the .jsp files is
unfortunately not realistic because we currently use thousands of .jsps.
The possible fix that Christopher suggested in the last message would be
the perfect solution.

Kind Regards

David
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: trimSpaces removing whitespace from html

Mark Thomas-2
On 29/05/17 09:09, David Kavanagh wrote:
> On 26 May 2017 at 22:33, Christopher Schultz <[hidden email]>
> wrote:
>
> Mark,
>
> On 5/26/17 6:59 AM, Mark Thomas wrote:

<snip/>

>>>> This is a potential use case for a recently closed (as WONTFIX)
>>>> enhancement request:
>>>>
>>>> https://bz.apache.org/bugzilla/show_bug.cgi?id=45931
>>>>
>>>> Whether this use case is sufficient to justify re-opening that
>>>> enhancement request, reviewing the patch and updating it for 9.0.x
>>>> is TBD. How realistic is it for you to apply the fix (using ${'
>>>> '}) described above?
>
> Would it be reasonable to change trimSpaces so that spaces within
> element attributes would be normalized to a single space, and others
> would be removed? I'm not sure how aware the parser is of the
> surrounding document structure.
>
> -chris

<snip/>

> Hey guys,
>
> Thanks again for the help. For the Tomcat setup we currently have, the
> first link sent my Mark is a good fix for us.
> The other option Mark posted that would require modifying the .jsp files is
> unfortunately not realistic because we currently use thousands of .jsps.
> The possible fix that Christopher suggested in the last message would be
> the perfect solution.

BZ 45931 it is then. Please re-open that enhancement request and link to
this thread as the use case that justifies it. If you wanted to take a
look at porting the patch as well, that would be great.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

12
Loading...