@ai-matrx/content-ir 0.19.9 → 0.19.11

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.js CHANGED
@@ -7747,11 +7747,14 @@ function isPipeLedRow(line) {
7747
7747
  const trimmed = line.trim();
7748
7748
  return trimmed.startsWith("|") && trimmed.includes("|", 1);
7749
7749
  }
7750
+ function isTableDelimiter(line) {
7751
+ if (line === void 0 || !isGfmDelimiterRow(line)) return false;
7752
+ return !BLOCK_START.test(line.trim());
7753
+ }
7750
7754
  function startsPipelessTable(header, delimiter) {
7751
7755
  const head = header.trim();
7752
- if (!head || head.startsWith("|") || startsBlock(head)) return false;
7753
- if (splitRowSegments(head).length < 2) return false;
7754
- if (delimiter === void 0 || !isGfmDelimiterRow(delimiter)) return false;
7756
+ if (!head || isPipeLedRow(head) || !head.startsWith("|") && startsBlock(head)) return false;
7757
+ if (!isTableDelimiter(delimiter)) return false;
7755
7758
  return rowCells(head).length === rowCells(delimiter.trim()).length;
7756
7759
  }
7757
7760
  function continuesTable(line, containerIndent = 0) {
@@ -7792,7 +7795,11 @@ function isLazyContinuation(lines, index) {
7792
7795
  return lineIndent(header) < tableContainerIndentOf(lines, first, true);
7793
7796
  }
7794
7797
  function tableStartsAt(lines, index) {
7795
- return opensTable(lines, index) && isGfmDelimiterRow(lines[index + 1] ?? "");
7798
+ const header = lines[index] ?? "";
7799
+ const delimiter = lines[index + 1];
7800
+ if (!opensTable(lines, index) || !isTableDelimiter(delimiter)) return false;
7801
+ if (rowCells(header).length !== rowCells(delimiter).length) return false;
7802
+ return lineIndent(header) - tableContainerIndent(lines, index) < 4;
7796
7803
  }
7797
7804
  function findTableStart(lines, from = 0) {
7798
7805
  for (let i = Math.max(0, from); i < lines.length; i += 1) if (opensTable(lines, i)) return i;