unclebob / fitnesse

FitNesse -- The Acceptance Test Wiki
fitnesse.org
Other
2.04k stars 713 forks source link

HTML escaping seems to be broken for SLIM #292

Closed docbobo closed 11 years ago

docbobo commented 11 years ago

I tried to give FitNesse a try for the first time yesterday, together with RestFixture. Unfortunately, the results are not rendered correctly because the RestFixture results seem to be HTML escaped twice - once on the RestFixture/SlimServer side and once on the Fitnesse side.

Using 'git bisect', it seems that the following commit is the culprit:

e65c631d08a137382509bb32612ba5cfa1fecb15 is the first bad commit
commit e65c631d08a137382509bb32612ba5cfa1fecb15
Author: Arjan Molenaar <gaphor@gmail.com>
Date:   Wed Jan 30 22:23:56 2013 +0100

    * Fixed HTML escaping in HTMLTable
    * Added back counters, needs more work
    * interface cleanup

:040000 040000 4348c9c0a7f816803c9c4c1e85dda017ddc79027 6076b5200c28e8001dd65566aedfdd6531c41bf9 M  src

I did read somewhere that SLIM response should be already HTML escaped but failed to find this quote again. Can anybody confirm whether the SLIM response should already be escaped or not? This would determine whether this needs to be fixed on the FitNesse side or on the RestFixture side.

Thanks

amolenaar commented 11 years ago

The escaping in SLiM used to be very inconsistent. With the latest version I tried to make it consistent. As a rule of thumb all text will be escaped by FitNesse, so characters like < and > will be rendered properly. Also it releases the fixture writer from doing all sorts of escaping. I am aware that this will do a double escape, in case the fixture also does escaping. This, however, seems better than doing no escaping at all (which can really mess up test output).

amolenaar commented 11 years ago

Duplicate of #274.