You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dompurify.addHook('afterSanitizeAttributes', function (node) {
65
+
// set all elements owning target to target=_blank
66
+
if ('target'in node) {
67
+
node.setAttribute('target', '_blank');
68
+
node.setAttribute('rel', 'noopener');
69
+
}
70
+
});
71
+
return<RichTextField {...props} />;
72
+
};
73
+
74
+
constMyComponent= () => (
75
+
<TargetBlankEnabledRichTextField source="body"/>
76
+
);
77
+
```
78
+
79
+
**Tip:** Note that this also adds the `rel="noopener"` attribute to all links, to prevent [reverse tabnabbing](https://mathiasbynens.github.io/rel-noopener/).
0 commit comments