From 8b0e9984cf0dbf3deaa17e1997129e0c8de1aa1f Mon Sep 17 00:00:00 2001 From: David Taylor Date: Fri, 15 Mar 2024 02:48:24 +0000 Subject: [PATCH] FIX: Syntax highlighting for shared-ai conversions with CSP enabled (#532) - Adds a nonce to both script tags - Removes the `onload=` inline script, and moves the tags to the end of the `` instead. This provides the same UX (page will load and render, then hljs will be applied when ready) --- .../ai_bot/shared_ai_conversations/show.html.erb | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/app/views/discourse_ai/ai_bot/shared_ai_conversations/show.html.erb b/app/views/discourse_ai/ai_bot/shared_ai_conversations/show.html.erb index 1ac03d8f..7ce50635 100644 --- a/app/views/discourse_ai/ai_bot/shared_ai_conversations/show.html.erb +++ b/app/views/discourse_ai/ai_bot/shared_ai_conversations/show.html.erb @@ -11,14 +11,6 @@ "> - -