html-manipulations/addSummary.js: rename and document to reflect better what it does

This commit is contained in:
Hans Fast 2026-03-25 10:24:14 +01:00
parent da749db12a
commit 7af7f1f0e1
2 changed files with 3 additions and 1 deletions

View File

@ -1,3 +1,5 @@
//looks for an html comment pattern, and, if found,
//adds the text before it to the doc under the key `summary`.
const reg = /^(?<summary>.+)?<!--summary-above-->/s const reg = /^(?<summary>.+)?<!--summary-above-->/s
export default (doc) => { export default (doc) => {
const result = reg.exec(doc._body); const result = reg.exec(doc._body);

View File

@ -45,7 +45,7 @@
and ends up in a separate field of the document. and ends up in a separate field of the document.
So we dont have to worry about the title being part of the summary. So we dont have to worry about the title being part of the summary.
*/ */
withSummary: Tree.map(asHtml, ./html-manipulations/extractSummary.js) withSummary: Tree.map(asHtml, ./html-manipulations/addSummary.js)
/* /*
Removing private content coming below the html paragraph `<p>—private-below—</p>` Removing private content coming below the html paragraph `<p>—private-below—</p>`