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

fix: Change test output formatting from code to html #35857

Merged

Conversation

ojeytonwilliams
Copy link
Contributor

@ojeytonwilliams ojeytonwilliams commented Apr 16, 2019

  • I have read freeCodeCamp's contribution guidelines.
  • My pull request has a descriptive title (not a vague title like Update index.md)
  • My pull request targets the master branch of freeCodeCamp.
  • None of my changes are plagiarized from another source without proper attribution.
  • All the files I changed are in the same world language (for example: only English changes, or only Chinese changes, etc.)
  • My changes do not use shortened URLs or affiliate links.

This replaces the Output Monaco editor with a pre element and adds a little css. The idea being to highlight the output the same way as the TestSuite in the SidePanel, rather than treating it as JavaScript.

I thought it would be best to sanitize the output, because arbitrary output is possible via console logs. Finally, I removed <base href='/' /> because it did not seem to be doing anything!

Closes #35800 , closes #17925 and closes #35811

@ojeytonwilliams ojeytonwilliams requested a review from a team April 16, 2019 09:45
@raisedadead
Copy link
Member

hey @ojeytonwilliams can you please fixup up the lock files and package files. I seem to have created a conflict by merging the npm install PR. Thanks.

@ojeytonwilliams
Copy link
Contributor Author

@raisedadead Sure. Turns out santize-html was already being used.

Copy link
Member

@moT01 moT01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I tested this locally - after navigating the web of linked issues all over, this does look like it fixes the two main Issues. Along with make the console look a little cleaner overall. Here's some images..

Current beta:
Screen Shot 2019-05-03 at 3 02 04 PM

You can see the <strong> tags there
and the text turns to red after the apostrophe in element's

This PR:
Screen Shot 2019-05-03 at 3 01 59 PM

Looks good to me @ojeytonwilliams.

@raisedadead
Copy link
Member

✨ ✨ LGTM. ✨ ✨

Thanks @ojeytonwilliams

Happy Contributing!

@raisedadead raisedadead merged commit 60dd7ca into freeCodeCamp:master Jun 8, 2019
@ojeytonwilliams ojeytonwilliams deleted the fix/challenge-highlighting branch September 17, 2019 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Editor output displaying as code Challenge console doesn't escape single quotes
3 participants