-
Notifications
You must be signed in to change notification settings - Fork 525
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
Create a TypeScript type for HTML Strings #6210
Comments
We could use some kind of branding for it |
Would |
no it wouldn't that's just an alias. Like the linked article says, We usually try to very carefully guard where m.trust is used but inputs to those places could benefit from more strict typing |
I see. It is strange that TypeScript does not offer a way to strongly type built-in.
It would still be safer to guard types at this low level too however. |
FYI built-in support is coming in TypeScript. |
Did they promise it or is it just someone's proposal? |
It's in their roadmap, so likely yes. |
It would be ideal if we could have a special type for strings that contain HTML code to avoid accidentally passing it to functions that cannot handle it & avoid passing non-HTML strings to functions that expect HTML. For example, the
htmlSanitizer
orm.trust()
if it's possible to override its definition.The text was updated successfully, but these errors were encountered: