diff --git a/content/docs/custom-widgets.md b/content/docs/custom-widgets.md index 2874ed60..3ba6a956 100644 --- a/content/docs/custom-widgets.md +++ b/content/docs/custom-widgets.md @@ -145,7 +145,7 @@ CMS.registerEditorComponent({ // // Additionally, it's recommended that you use non-greedy capturing groups (e.g. // `(.*?)` vs `(.*)`), especially if matching against newline characters. - pattern: /^
$\s*?(.*?)<\/summary>\n\n(.*?)\n^<\/details>$/ms, + pattern: /^
(.*?)<\/summary>(.*?)<\/details>$/ms, // Given a RegExp Match object // (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match#return_value), // return an object with one property for each field defined in `fields`. @@ -163,14 +163,7 @@ CMS.registerEditorComponent({ // This is used to serialize the data from the custom widget to the // markdown document toBlock: function(data) { - return ` -
- ${data.summary} - - ${data.contents} - -
-`; + return `
${data.summary}${data.contents}
`; }, // Preview output for this component. Can either be a string or a React component // (component gives better render performance)