@ai-matrx/content-ir 0.16.0 → 0.16.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/source.cjs CHANGED
@@ -924,7 +924,8 @@ var Tokenizer = class {
924
924
  const fm = this.frontMatter(li, t);
925
925
  if (fm) return fm;
926
926
  }
927
- if (indent <= 3 && t.startsWith("::")) {
927
+ const listNested = indent > 0 && this.inListContinuation(li);
928
+ if (indent <= 3 && !listNested && t.startsWith("::")) {
928
929
  const directive = this.directive(p, li, t);
929
930
  if (directive) return directive;
930
931
  }
@@ -932,7 +933,7 @@ var Tokenizer = class {
932
933
  const admonition = this.mkdocsAdmonition(p, li, t);
933
934
  if (admonition) return admonition;
934
935
  }
935
- if (indent <= 3 && t.startsWith(">")) {
936
+ if (indent <= 3 && !listNested && t.startsWith(">")) {
936
937
  const callout = this.callout(p, li, t);
937
938
  if (callout) return callout;
938
939
  }
@@ -973,6 +974,17 @@ var Tokenizer = class {
973
974
  }
974
975
  return null;
975
976
  }
977
+ /** True when line `li` continues a list item (the nearest non-blank line above is a list item or indented text under one). */
978
+ inListContinuation(li) {
979
+ for (let k = li - 1; k >= 0; k--) {
980
+ const line = this.lineText(k);
981
+ if (!NOT_WHITESPACE.test(line)) continue;
982
+ if (/^[ \t]*(?:[-*+]|\d{1,9}[.)])[ \t]/.test(line)) return true;
983
+ if (/^[ \t]/.test(line)) continue;
984
+ return false;
985
+ }
986
+ return false;
987
+ }
976
988
  island(type, start, end, complete, meta = {}) {
977
989
  return { type, start, end, complete, meta };
978
990
  }