Skip to content

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

Merged
merged 2 commits into from
Jan 23, 2018
Merged

Fix colors not showing #265

merged 2 commits into from
Jan 23, 2018

Conversation

houfio
Copy link
Contributor

@houfio houfio commented Jan 21, 2018

Also fixes the   on newlines.

See #196

Also fixes the ` ` on newlines.
@@ -1 +1 @@
setInterval(() => console.log(Math.random()), 100)
setInterval(() => console.log('[31m' + Math.random() + '\n'), 200)
Copy link
Contributor

@j-f1 j-f1 Jan 21, 2018

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?

Copy link
Contributor Author

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.

@@ -12,7 +11,6 @@ export function formatLines(str: string): string[] {
.split('\n')
.map(blankLine)
.map(ansi2HTML)
.map(escapeHTML)
Copy link
Contributor

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?

Copy link
Owner

@typicode typicode Jan 21, 2018

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
@typicode
Copy link
Owner

Thank you!

@typicode typicode merged commit 0c6c9ab into typicode:master Jan 23, 2018
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.

3 participants