@ai-matrx/content-ir 0.19.9 → 0.19.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/source.cjs CHANGED
@@ -2693,11 +2693,14 @@ function isPipeLedRow(line) {
2693
2693
  const trimmed = line.trim();
2694
2694
  return trimmed.startsWith("|") && trimmed.includes("|", 1);
2695
2695
  }
2696
+ function isTableDelimiter(line) {
2697
+ if (line === void 0 || !isGfmDelimiterRow(line)) return false;
2698
+ return !BLOCK_START.test(line.trim());
2699
+ }
2696
2700
  function startsPipelessTable(header, delimiter) {
2697
2701
  const head = header.trim();
2698
- if (!head || head.startsWith("|") || startsBlock(head)) return false;
2699
- if (splitRowSegments(head).length < 2) return false;
2700
- if (delimiter === void 0 || !isGfmDelimiterRow(delimiter)) return false;
2702
+ if (!head || isPipeLedRow(head) || !head.startsWith("|") && startsBlock(head)) return false;
2703
+ if (!isTableDelimiter(delimiter)) return false;
2701
2704
  return rowCells(head).length === rowCells(delimiter.trim()).length;
2702
2705
  }
2703
2706
  function continuesTable(line, containerIndent = 0) {
@@ -2738,7 +2741,11 @@ function isLazyContinuation(lines, index) {
2738
2741
  return lineIndent(header) < tableContainerIndentOf(lines, first, true);
2739
2742
  }
2740
2743
  function tableStartsAt(lines, index) {
2741
- return opensTable(lines, index) && isGfmDelimiterRow(lines[index + 1] ?? "");
2744
+ const header = lines[index] ?? "";
2745
+ const delimiter = lines[index + 1];
2746
+ if (!opensTable(lines, index) || !isTableDelimiter(delimiter)) return false;
2747
+ if (rowCells(header).length !== rowCells(delimiter).length) return false;
2748
+ return lineIndent(header) - tableContainerIndent(lines, index) < 4;
2742
2749
  }
2743
2750
  function findTableStart(lines, from = 0) {
2744
2751
  for (let i = Math.max(0, from); i < lines.length; i += 1) if (opensTable(lines, i)) return i;