Title: Strict CSP breaks bold tags in annotation text · Issue #7380 · plotly/plotly.js · GitHub
Open Graph Title: Strict CSP breaks bold tags in annotation text · Issue #7380 · plotly/plotly.js
X Title: Strict CSP breaks bold tags in annotation text · Issue #7380 · plotly/plotly.js
Description: Using the new strict CSP support breaks bold tags in annotation text. Steps to reproduce: Include the plotly.css file. Content Security Policy that disallows inline stylesheets. Annotations where the text includes tag. I've reproduce...
Open Graph Description: Using the new strict CSP support breaks bold tags in annotation text. Steps to reproduce: Include the plotly.css file. Content Security Policy that disallows inline stylesheets. Annotations where t...
X Description: Using the new strict CSP support breaks bold tags in annotation text. Steps to reproduce: Include the plotly.css file. Content Security Policy that disallows inline stylesheets. Annotations where t...
Opengraph URL: https://github.com/plotly/plotly.js/issues/7380
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Strict CSP breaks bold tags in annotation text","articleBody":"Using the new strict CSP support breaks bold tags in annotation text.\n\n### Steps to reproduce:\n1. Include the plotly.css file.\n2. Content Security Policy that disallows inline stylesheets.\n3. Annotations where the text includes `\u003cb\u003e` tag.\n\nI've reproduced this problem in Vue 3 with Plotly 3.0.1 here: https://stackblitz.com/edit/vitejs-vite-1gco7d7q?file=src%2Fcomponents%2FPlotlyExample.vue\n\nThe Plotly code is like so, with bold tags around the text annotations **X axis** and **Y axis**\n```\n Plotly.newPlot(plotlyContainer.value, [{ x: [1, 2, 3], y: [2, 1, 2] }], {\n annotations: [\n {\n xref: 'paper',\n yref: 'paper',\n x: 0,\n xanchor: 'right',\n y: 1,\n yanchor: 'bottom',\n text: '\u003cb\u003eX axis\u003c/b\u003e label',\n showarrow: false,\n },\n {\n xref: 'paper',\n yref: 'paper',\n x: 1,\n xanchor: 'left',\n y: 0,\n yanchor: 'top',\n text: '\u003cb\u003eY axis\u003c/b\u003e label',\n showarrow: false,\n },\n ],\n });\n```\n\nCSP:\n```\n \u003cmeta\n http-equiv=\"Content-Security-Policy\"\n content=\"default-src 'self'; img-src 'self' data: blob:; style-src 'self' 'sha256-jehvI5/Zi1PSH21Fi6ZfQYAtiGucyVGUH4ziRLU+Bfc=';\"\n /\u003e\n```\n\n(NOTE: because of how the Vite dev server works, I need to include the sha256 checksum of the plotly-3.0.1.css file, in a production build it wouldn't be necessary.)\n\n### Expected result:\n\n\n\nI produced this image by commenting out the CSP meta tag in the reproduction code linked to above.\n\n### Actual result:\n\n","author":{"url":"https://github.com/inari-mchristie","@type":"Person","name":"inari-mchristie"},"datePublished":"2025-02-27T15:52:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/7380/plotly.js/issues/7380"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:59389815-38ac-14f5-d0a8-e660b2d60cf6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AAAA:9FF13:E949D:136728:6A56D05C |
| html-safe-nonce | bac7ac8b30a883d7e9fc03fe337048d03c8c0eca563312b975c4f01b3f2ec5e1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQUFBOjlGRjEzOkU5NDlEOjEzNjcyODo2QTU2RDA1QyIsInZpc2l0b3JfaWQiOiIxMDQ2NzM1OTc3NjY0OTI1Nzg4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | adc3ac4834414e9e1ebf7385f4d6e7fe4c44a45b75247871b895fc1f4099a006 |
| hovercard-subject-tag | issue:2884924400 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/plotly/plotly.js/7380/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4247f0982453b6e86e721e27f5a64f45c3ec7ee3d17aa06512f2a35446def09b/plotly/plotly.js/issues/7380 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4247f0982453b6e86e721e27f5a64f45c3ec7ee3d17aa06512f2a35446def09b/plotly/plotly.js/issues/7380 |
| og:image:alt | Using the new strict CSP support breaks bold tags in annotation text. Steps to reproduce: Include the plotly.css file. Content Security Policy that disallows inline stylesheets. Annotations where t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | inari-mchristie |
| hostname | github.com |
| expected-hostname | github.com |
| None | df99b7164e1d961b639cf5d3cbd6b5ba673edc67bd7e47cdc4746b96099e11ae |
| turbo-cache-control | no-preview |
| go-import | github.com/plotly/plotly.js git https://github.com/plotly/plotly.js.git |
| octolytics-dimension-user_id | 5997976 |
| octolytics-dimension-user_login | plotly |
| octolytics-dimension-repository_id | 45646037 |
| octolytics-dimension-repository_nwo | plotly/plotly.js |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 45646037 |
| octolytics-dimension-repository_network_root_nwo | plotly/plotly.js |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3146ab55fc8763ab0e1d2a875e600b3a545bc751 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width