diff --git a/src/trix/core/helpers/custom_elements.js b/src/trix/core/helpers/custom_elements.js index 5273fe63b..1e0fc5734 100644 --- a/src/trix/core/helpers/custom_elements.js +++ b/src/trix/core/helpers/custom_elements.js @@ -20,7 +20,8 @@ const insertStyleElementForTagName = function(tagName) { const getCSPNonce = function() { const element = getMetaElement("trix-csp-nonce") || getMetaElement("csp-nonce") if (element) { - return element.getAttribute("content") + const { nonce, content } = element + return nonce == "" ? content : nonce } }