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