-
Notifications
You must be signed in to change notification settings - Fork 109
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
Pasting text with '<' and '>' doesn't work correctly #86
Labels
bug
It's a bug!
Comments
Thanks for the report! The source of the problem is probably here: AngularJS sanitizes HTML tags using a whitelist. Before sanitizing the input, we should probably escape "dangerous" symbols like |
dbrgn
pushed a commit
that referenced
this issue
Feb 27, 2017
Sanitizing text would cause some non-HTML text to disappear (see #86). Instead, we escape HTML, so that it looks exactly like pasted. The applyFilters helper function has been removed, it's unclear what it does. Being explicit is better in this case. Pasting emoji tags still works, because <img> tags are converted to their alt-text, which is in turn converted back to an <img> tag by the emojify filter.
dbrgn
pushed a commit
that referenced
this issue
Feb 27, 2017
Sanitizing text would cause some non-HTML text to disappear (see #86). Instead, we escape HTML, so that it looks exactly like pasted. The applyFilters helper function has been removed, it's unclear what it does. Being explicit is better in this case.
dbrgn
pushed a commit
that referenced
this issue
Feb 27, 2017
Sanitizing text would cause some non-HTML text to disappear (see #86). Instead, we escape HTML, so that it looks exactly like pasted. The applyFilters helper function has been removed, it's unclear what it does. Being explicit is better in this case.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected Behavior
When pasting text like
lorem ipsum x<y blah blah
orlorem ipsum x<y blah blah y>z foo bar
into the message text field, exactly this text should appear in the text field.Current Behavior
The first text gets cut off at the '<' character, only
lorem ipsum x
appears in the text field.In the second sample, everything between the two brackets disappears, resulting in
lorem ipsum xz foo bar
.Possible Solution
There is probably something up with the regexes in filter.ts, I couldn't find anything obvious, though.
Steps to Reproduce (for bugs)
lorem ipsum x<y blah blah y>z foo bar
into your clipboardYour Environment
The text was updated successfully, but these errors were encountered: