@@ -70,20 +70,13 @@ However, each renderer supports a set of props, including `className` which can
7070 className: " article-hr"
7171 },
7272 embed: {
73- className: " styled-iframe" ,
74- rel: " nofollower" ,
75- sandbox: " allow-fullscreen"
73+ className: " styled-iframe"
7674 }
7775 header: {
7876 className: " lead"
7977 },
8078 image: {
81- className: " img-fluid" ,
82- actionsClassNames: {
83- stretched: ' image-block--stretched' ,
84- withBorder: ' image-block--with-border' ,
85- withBackground: ' image-block--with-background' ,
86- }
79+ className: " img-fluid"
8780 },
8881 list: {
8982 className: " unstyled-list"
@@ -92,18 +85,57 @@ However, each renderer supports a set of props, including `className` which can
9285 className: " lead"
9386 },
9487 quote: {
95- className: " block-quote" ,
96- actionsClassNames: {
97- alignment: ' text-align-{alignment}' , // This is a substitution placeholder: left or center.
98- }
88+ className: " block-quote"
9989 },
10090 table: {
10191 className: " table"
10292 }
10393}} / >
10494```
10595
106- Above you have all allowed properties for each renderer.
96+ Below are the defaults for each renderer:
97+
98+ ``` js
99+ const defaultConfigs = {
100+ code: {
101+ className: " "
102+ },
103+ delimiter: {
104+ className: " "
105+ },
106+ embed: {
107+ className: " styled-iframe" ,
108+ rel: " noreferer nofollower external" , // Generates an <a> if not able to receive an "embed" property
109+ sandbox: undefined
110+ }
111+ header: {
112+ className: " "
113+ },
114+ image: {
115+ className: " " ,
116+ actionsClassNames: {
117+ stretched: " image-block--stretched" ,
118+ withBorder: " image-block--with-border" ,
119+ withBackground: " image-block--with-background" ,
120+ }
121+ },
122+ list: {
123+ className: " "
124+ },
125+ paragraph: {
126+ className: " "
127+ },
128+ quote: {
129+ className: " " ,
130+ actionsClassNames: {
131+ alignment: " text-align-{alignment}" , // This is a substitution placeholder: left or center.
132+ }
133+ },
134+ table: {
135+ className: " table"
136+ }
137+ }
138+ ```
107139
108140So, in theory, any CSS framework (such as Bootstrap) can work seamlessly with this library as long as you pass the correct properties.
109141
@@ -137,6 +169,11 @@ export default () => <Blocks data={dataFromEditor} renderers={{
137169}} />
138170```
139171
172+ ## Security optimization
173+
174+ For ` embed ` block, you can pass a string of Feature-Policy directives for ` sandbox ` to optimize for security. Take into account that services such as YouTube won't work properly if you set those settings.
175+
176+
140177## Inspiration
141178
142179- [ EditorJS-React-Renderer] ( https://github.com/BomdiZane/EditorJS-React-Renderer ) but without opinated inline styles.
0 commit comments