MCPcopy Create free account
hub / github.com/decaporg/decap-cms / useRichTextWidget

Function useRichTextWidget

cypress/plugins/index.js:177–195  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

175 return null;
176 },
177 async useRichTextWidget() {
178 console.log('Updating config to use richtext widget');
179 await updateConfig(current => {
180 if (current.collections) {
181 current.collections = current.collections.map(collection => {
182 if (collection.fields) {
183 collection.fields = collection.fields.map(field => {
184 if (field.widget === 'markdown') {
185 return { ...field, widget: 'richtext' };
186 }
187 return field;
188 });
189 }
190 return collection;
191 });
192 }
193 });
194 return null;
195 },
196 });
197
198 addMatchImageSnapshotPlugin(on, config);

Callers

nothing calls this directly

Calls 2

mapMethod · 0.80
updateConfigFunction · 0.70

Tested by

no test coverage detected