Hi Sven,

On Thu, Jun 25, 2015 at 4:08 PM, Sven Meier <[email protected]> wrote:

> Hi all,
>
> currently AjaxRequestHandler escapes CDATA as follows:
>
>     Strings.replaceAll(str, "]", "]^")
>
> decode() in wicket-ajax-jquery.js does the inverse on processing of the
> ajax response:
>
>     replaceAll(text, "]^", "]")
>
> But the recommended approach to handle nested CDATA sections is to split
> each "]]>" with an additional CDATA end/start:
>

Any reference to the recommendation?


>
>     Strings.replaceAll(str, "]]>", "]]" + "]]><![CDATA[" + ">");
>

Did you skip some part(s) here?
Why "]]" + "]]><![CDATA[" + ">" is not just "]]]]><![CDATA[>"? Why is
needed the concatenation?


>
> Does anybody know why we don't do it this way?
>

I guess the reason is that this is really old code that worked well so far.


>
> The nice thing about the latter solution is that wicket-ajax-jquery.js
> doesn't have to know anything about escaping, because the XML parser will
> automatically take care of it.
>

I don't mind doing the change.
I think there are JS tests for the current way. Please replace them with
tests which parse mock response with the new approach.


>
> Thanks
> Sven
>
>
>

Reply via email to