PMunch / nim-playground-frontend

The front-end for https://play.nim-lang.org
45 stars 16 forks source link

Compiler and program output aren't HTML-escaped #1

Closed sschwarzer closed 5 years ago

sschwarzer commented 5 years ago

Copied from https://github.com/zacharycarter/nim-playground/issues/4 :

For example, if you enter the snippet

echo "<b>foo</b>"

"foo" is displayed in bold.

For the compiler output it's also quite inconvenient because error messages that include a <Type> in angle brackets are seen as invalid tags by the browser and aren't displayed.

PMunch commented 5 years ago

Ah yes, this is a known issue. I am currently redoing that part of the code, moving the ANSI -> HTML colourisation from the front-end to the server. But since I couldn't find any ANSI -> HTML libraries I have to write that first. Once that's in place the output from the compiler should first be HTML escaped, then colourised, then passed to the front-end for direct display.

PMunch commented 5 years ago

This has now been done, and the playground now escapes HTML and uses the ANSI colour to colourise the output.