GitHub user dosubot[bot] added a comment to the discussion: render as html
<!-- Answer --> This is expected behavior — "Render as HTML" only controls how values are **displayed in the browser**. When you export to CSV/Excel, Superset pulls the raw query results directly, so your `<span>` tags come through as-is in the export [[1]](https://github.com/apache/superset/discussions/40044#discussioncomment-16887507). **Recommended fix: Use Conditional Formatting instead** If your goal is just coloring values, use Superset's built-in **Conditional Formatting** (under the "Customize" tab in the Table chart). This applies colors natively without injecting HTML into the metric, so exports will contain only clean values. **Other workarounds:** 1. **Post-process in Excel** — Use Find & Replace or `=SUBSTITUTE()` to strip the span tags after export. 2. **Backend modification** — If you want to strip HTML globally for all exports, you can modify `superset/common/query_context_processor.py` in the `get_data()` method by adding regex-based HTML stripping before the CSV/Excel conversion: ```python import re # Add after verbose_map processing, before CSV/Excel conversion: for col in df.columns: if df[col].dtype == "object": df[col] = df[col].apply( lambda x: re.sub(r'<[^>]+>', '', x) if isinstance(x, str) else x ) ``` [[1]](https://github.com/apache/superset/discussions/40044#discussioncomment-16887507) The conditional formatting approach is the cleanest solution since it separates styling from data entirely. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).* --- Share context across your team and agents. Try [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-tagline&utm_term=apache%2Fsuperset). [](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-feedback&utm_term=apache%2Fsuperset&message_id=91ea847e-b0aa-486e-9157-1703c0498a20) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-learn-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-add-team&utm_term=apache%2Fsuperset) GitHub link: https://github.com/apache/superset/discussions/40900#discussioncomment-17232833 ---- This is an automatically sent email for [email protected]. To unsubscribe, please send an email to: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
