@dloizides/poster-render 0.13.0 → 0.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -928,7 +928,9 @@ function halves(text2) {
928
928
  }
929
929
  function wrapped(line, wrap) {
930
930
  const parts = wrap ? halves(line.text) : [line.text];
931
- return parts.length === 1 ? [line] : parts.map((text2, i) => i === 0 ? { ...line, text: text2, tail: void 0 } : { ...line, text: text2, tail: void 0, bullet: void 0, hang: line.bullet !== void 0 });
931
+ const last = parts.length - 1;
932
+ const edges = (i) => ({ spaceAbove: i === 0 ? line.spaceAbove : void 0, spaceBelow: i === last ? line.spaceBelow : void 0 });
933
+ return parts.length === 1 ? [line] : parts.map((text2, i) => i === 0 ? { ...line, ...edges(i), text: text2, tail: void 0 } : { ...line, ...edges(i), text: text2, tail: void 0, bullet: void 0, hang: line.bullet !== void 0 });
932
934
  }
933
935
  function scheduleLines(doc, l, row, i) {
934
936
  const r3 = doc.rows;