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

Allow notifications to have newlines #8743

Closed
NiklasRentzCAU opened this issue Nov 12, 2020 · 3 comments
Closed

Allow notifications to have newlines #8743

NiklasRentzCAU opened this issue Nov 12, 2020 · 3 comments
Labels
notifications issues related to notifications proposal feature proposals (potential future features)

Comments

@NiklasRentzCAU
Copy link

Feature Description:

As of this commit, notifications cannot be rendered using any form of newline supported by markdown. As all HTML tags, including <br> are removed (sensible for preventing any XSS attacks) and all '\n' are removed, no way of defining newlines in markdown can be used anymore. This behavior is the same in VSCode, but highly requested to change there as well (see their issue #101589).

I would specifically like this feature to be able to show exception traces generated on a server application to the user. Those notifications are currently being butchered as all formatting for the stack trace is removed.

Other than aligning with VSCode, is there any specific reason to not support newlines in the notifications? Or is there some way around this to still be able to configure the notifications to allow for newlines?

@vince-fugnitto vince-fugnitto added proposal feature proposals (potential future features) notifications issues related to notifications labels Nov 12, 2020
@vince-fugnitto
Copy link
Member

@NiklasRentzCAU

Other than aligning with VSCode, is there any specific reason to not support newlines in the notifications?

The main reason is to align with vscode, and have a consistent representation of newlines in standard notifications.
Please note that it is possible to use modal notifications to render newlines if needed: #7500.

I would specifically like this feature to be able to show exception traces generated on a server application to the user.

I do not believe the framework wants to deviate from vscode at this time and have an inconsistent behavior when displaying messages. If and when #101589 has been implemented we can re-work the current default implementation.

Or is there some way around this to still be able to configure the notifications to allow for newlines?

The framework provides a default implementation, it is always possible for downstream application developers to define their own custom @theia/ extensions which extend/override the default implementation to suit their needs and use-cases. In this case, you can extend the implementation for notifications to support markdown and/or newlines.

@NiklasRentzCAU
Copy link
Author

Thank you, I just extended the implementation for my application to allow newlines again. Thank you for the insight!

@vince-fugnitto
Copy link
Member

Closing the issue due to the following reasons:

  • there are no plans on deviating the default behavior with vscode, downstream applications may define their own behavior
  • notifications with newlines are possible using the modal option
  • the previous implementation had security concerns

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notifications issues related to notifications proposal feature proposals (potential future features)
Projects
None yet
Development

No branches or pull requests

2 participants