@markdoc/markdoc 0.5.9 → 0.5.10

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
@@ -7279,8 +7279,9 @@ function* formatNode(n, o = {}) {
7279
7279
  break;
7280
7280
  }
7281
7281
  case "blockquote": {
7282
- const prefix = ">" + SPACE;
7283
- yield n.children.map((child) => format(child, no).trimStart()).map((d) => NL + indent + prefix + d).join(indent + prefix);
7282
+ const prefix = NL + indent + ">" + SPACE;
7283
+ const inner = n.children.map((child) => format(child, { ...no, indent: 0 }).trim()).join(NL + NL);
7284
+ yield prefix + inner.split(NL).join(prefix) + NL;
7284
7285
  break;
7285
7286
  }
7286
7287
  case "hr": {
@@ -8306,8 +8307,9 @@ function block(state, startLine, endLine, silent) {
8306
8307
  const lastPossible = state.src.slice(0, finish).trim().length;
8307
8308
  if (!tagEnd || tagEnd < lastPossible - CLOSE.length) return false;
8308
8309
  const contentStart = start + OPEN.length;
8309
- const content = state.src.slice(contentStart, tagEnd).trim();
8310
8310
  const lines = state.src.slice(start, tagEnd + CLOSE.length).split("\n").length;
8311
+ const text2 = state.getLines(startLine, startLine + lines, 0, false);
8312
+ const content = text2.slice(text2.indexOf(OPEN) + OPEN.length, findTagEnd(text2)).trim();
8311
8313
  if (content[0] === "$") return false;
8312
8314
  if (silent) return true;
8313
8315
  const token = createToken(state, content, contentStart);