Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

escaping error message content prevents displaying images in results #968

Closed
maliberty opened this issue Sep 6, 2013 · 2 comments
Closed
Labels
status: waiting for author waiting on response from OP - more information needed

Comments

@maliberty
Copy link

I'm new to Mocha but liking it so far. I wanted to port over js-imagediff (https://github.com/HumbleSoftware/js-imagediff) to Mocha as it only provides a jasmine interface currently. It nicely shows a graphical diff in its error output as can be seen at the example at http://humblesoftware.github.io/js-imagediff/test.html

The problem I've run into with mocha is that it html escapes the error messages preventing the embedding of images. This makes a port impossible. As far as I can see the issue lies in html.js

el.appendChild(fragment('

%e
', str));

where the %e invokes escaping on the message. Perhaps the framework could provide an option for the matcher to say the output shouldn't be escaped. I image a flag on the test.err could serve this purpose.

If this seems reasonable I'm willing to work on such a change.

@boneskull
Copy link
Contributor

possible to catch the errors and unescape them?

@boneskull boneskull added the status: waiting for author waiting on response from OP - more information needed label Apr 9, 2015
@boneskull
Copy link
Contributor

closing as old

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting for author waiting on response from OP - more information needed
Projects
None yet
Development

No branches or pull requests

2 participants