massucattoj opened a new pull request, #37104: URL: https://github.com/apache/superset/pull/37104
<!--- Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/ Example: fix(dashboard): load charts correctly --> ### SUMMARY Adds an example configuration for `HTML_SANITIZATION_SCHEMA_EXTENSIONS` in the development config to allow iframe embedding in Markdown components and Handlebars charts. By default, Superset's HTML sanitization (using GitHub's schema via `rehype-sanitize`) strips iframe tags for security reasons. This prevents users from embedding content like YouTube videos in dashboard Markdown components, even when specifying width/height attributes. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF - The **BEFORE** is nothing. Markdown and Handlebars are ignoring the iframe tag. https://github.com/user-attachments/assets/0e468770-75ae-405a-9171-5da886ac321d https://github.com/user-attachments/assets/7bbd2b15-8a7c-4f73-b48b-182dcbd1522d ### TESTING INSTRUCTIONS <!--- Required! What steps can be taken to manually verify the changes? --> First scenario: Adding iframe to Dashboard markdown content 1. In shell, Navigate to Dashboards 2. Select to create / edit a dashboard 3. Add a markdown component 4. Copy the iframe code of a youtube video (from share > embed option) 5. Paste the iframe code to the Dashboard and save 6. Notice the video will fill the entire markdown area 7. Try editing the dashboard and changing the width or the height of the video 8. Notice the changes **NOW** make effect into the Dashboard Second scenario: Adding Iframe to a Handlebar chart 1. In shell navigate to database connections 2. Connect to a new Google Sheet and paste the following sheet: https://docs.google.com/spreadsheets/d/1O4wGQUgiSgMlAdyg7YJebl3NZpAgx4GTUfhwjZXHAWI/edit?gid=0#gid=0 3. Save 4. Navigate to Datasets 5. Add a new Dataset for the connected Google sheet 6. Click to save and create a new chart 7. Change chart type to Handlebar 8. Go to Customize and add this piece of code on template ``` <ul> {{#each data}} <li><iframe width="560" height="315" src="{{url}}" title="Video" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen> </iframe></li> {{/each}} </ul> ``` 9. All should work as expected. ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] Introduces new feature or API - [ ] Removes existing feature or API -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
