-
-
Notifications
You must be signed in to change notification settings - Fork 427
Fix colors not showing #265
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
Conversation
Also fixes the ` ` on newlines.
@@ -1 +1 @@ | |||
setInterval(() => console.log(Math.random()), 100) | |||
setInterval(() => console.log('[31m' + Math.random() + '\n'), 200) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this have an escape character in it? If so, can you put it in the string with a backslash escape so it’s easier to read?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I don't really get what you mean. Nothing in the string needs escaping.
src/app/formatter.ts
Outdated
@@ -12,7 +11,6 @@ export function formatLines(str: string): string[] { | |||
.split('\n') | |||
.map(blankLine) | |||
.map(ansi2HTML) | |||
.map(escapeHTML) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this open Hotel up to XSS attacks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I would say risks are low, but would feel safer with html escaped.
Without speaking of attacks, if you have some tags, like <h1>
in your output, it will "break" output style.
If I'm not wrong, modern front-end tools, like create-react-app
, tend to log JSX
in the output if there are errors.
Also add proper types to fix type errors
Thank you! |
Also fixes the
on newlines.See #196