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