-
Notifications
You must be signed in to change notification settings - Fork 3
HTML Tool PoC spike for fragment defined in type index #151
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
base: main
Are you sure you want to change the base?
Conversation
| it('is whitelisted by sanitizeHtmlTool', () => { | ||
| const sanitized = sanitizeHtmlTool('<pos-label/>'); | ||
| expect(sanitized).toEqual('<pos-label/>'); | ||
| }); |
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.
As noted in #126 (comment), my intention here is that each white-listed component would manage its own set of tests to ensure that the HTML sanitization whitelists the right attributes etc. So when other changes are made, then these HTML sanitization tests are also updated.
(This is obviously dependent on getting DOMPurify to run correctly in the tests.)
97bc483 to
61b93f9
Compare
| ], | ||
| fragment: '<pos-label/>', | ||
| }, | ||
| ]; |
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.
This will need to be loaded from type index with defaults for missing values. New PodOS core methods will be needed.
| <SelectedTool class="tool visible"></SelectedTool> | ||
| {SelectedTool == 'pos-html-tool' ? ( | ||
| <pos-html-tool | ||
| fragment={(this.currentTool as HTMLToolConfig).fragment} |
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.
This is not quite the right solution to support more than one HTML tool (if several types match). It doesn't allow them to be addressed separately through URL params.
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.
I'm considering instead allowing tools to be registered with a unique name. This would be user friendly but require an additional predicate to be present in the registration.
Another alternative would be a hash of their content. This would more opaque.
|
The current implementation works - navigating to |
Closes #146
Keep a Changelog