Przeglądaj źródła

allow data attributes

Yuki Takei 3 lat temu
rodzic
commit
3ea8fc0f2c
1 zmienionych plików z 3 dodań i 1 usunięć
  1. 3 1
      packages/app/src/services/renderer/renderer.tsx

+ 3 - 1
packages/app/src/services/renderer/renderer.tsx

@@ -71,7 +71,9 @@ const baseSanitizeSchema = {
   tagNames: ['iframe'],
   attributes: {
     iframe: ['allow', 'referrerpolicy', 'sandbox', 'src', 'srcdoc'],
-    '*': ['class', 'className', 'style'],
+    // The special value 'data*' as a property name can be used to allow all data properties.
+    // see: https://github.com/syntax-tree/hast-util-sanitize/
+    '*': ['class', 'className', 'style', 'data*'],
   },
 };