goldjee commented on issue #30381:
URL: https://github.com/apache/superset/issues/30381#issuecomment-2372569881
@dosu
There was a mistake on my side: I was passing wrong config file while
starting Superset. Fixed that. Now I can see that
`HTML_SANITIZATION_SCHEMA_EXTENSIONS` is sent to the frontend correctly.
Anyway, when I pass the config file with
```Python
HTML_SANITIZATION = True
HTML_SANITIZATION_SCHEMA_EXTENSIONS = {
"attributes": {
"*": ["style","className"],
},
"tagNames": ["style"],
}
```
the `class` attribute is blank for processed HTML template.
My chart config is as follows. HTML:
```HTML
<ul class="data-list">
{{#each data}}
<li>{{descr}}</li>
{{/each}}
</ul>
```
CSS:
```CSS
.data-list {
background-color: yellow;
list-style: none;
}
```
Output HTML in the chart is:
```HTML
<ul class="">
<li>Quisque vehicula pharetra velit, vel pharetra erat pellentesque a.
Maecenas molestie maximus sem, ac dapibus.</li>
<li>Aliquam posuere malesuada pharetra. Pellentesque id vulputate elit.
Proin tristique fringilla odio vel vehicula. Cras.</li>
</ul>
```
If I disable sanitization, the CSS is applied properly. It points out that
my `HTML_SANITIZATION_SCHEMA_EXTENSIONS` is probably missing something.
--
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]