//looks for an html comment pattern, and, if found, //adds the text before it to the doc under the key `summary`. const reg = /.*(?.+)?/s //use a custom element instead. // const reg = /(?.+)?<\/doc-summary>/s export default (doc) => { const result = reg.exec(doc._body); if (result) { doc.summary = result.groups.summary; } return doc; }