@ai-matrx/content-ir 0.21.1 → 0.22.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/index.js CHANGED
@@ -5481,9 +5481,9 @@ function fenceOpenerOf(content) {
5481
5481
  function opensStrictFence(line) {
5482
5482
  return fenceOpenerOf(line) !== null;
5483
5483
  }
5484
+ var LINE_START = { inString: false, escaped: false };
5484
5485
  var FenceReader = class {
5485
5486
  opener;
5486
- state = { inString: false, escaped: false };
5487
5487
  depth = 0;
5488
5488
  /** A nested fence was opened at some point. */
5489
5489
  sawNested = false;
@@ -5504,17 +5504,8 @@ var FenceReader = class {
5504
5504
  if (this.tildeCloser) return this.tildeCloser.test(line);
5505
5505
  const trimmedLine = trimFenceLine(line);
5506
5506
  const at = line.indexOf("```");
5507
- if (at === -1) {
5508
- if (this.isJson) this.state = jsonStringState(line, 0, line.length, this.state);
5509
- return false;
5510
- }
5511
- if (this.isJson) {
5512
- const probe = jsonStringState(line, 0, at, this.state);
5513
- if (probe.inString) {
5514
- this.state = jsonStringState(line, at, line.length, probe);
5515
- return false;
5516
- }
5517
- }
5507
+ if (at === -1) return false;
5508
+ if (this.isJson && jsonStringState(line, 0, at, LINE_START).inString) return false;
5518
5509
  if (trimmedLine.startsWith("```")) {
5519
5510
  const kind = classifyInnerFenceLine(trimmedLine, this.opener.ticks, this.nesting, this.depth);
5520
5511
  if (kind === "close-outer") return true;
@@ -5528,7 +5519,6 @@ var FenceReader = class {
5528
5519
  const after = trimFenceLine(line.slice(at + closeTicks));
5529
5520
  if (closeTicks >= this.opener.ticks && after === "" && this.depth === 0) return true;
5530
5521
  }
5531
- if (this.isJson) this.state = jsonStringState(line, 0, line.length, this.state);
5532
5522
  return false;
5533
5523
  }
5534
5524
  };
@@ -6063,6 +6053,7 @@ var XML_NAME_START = /[A-Za-z_]/;
6063
6053
  var XML_NAME_CHARACTER = /[\w.:-]/;
6064
6054
  var WHITESPACE = /\s/;
6065
6055
  function readXmlTag(content, start, find = (needle, from) => content.indexOf(needle, from)) {
6056
+ if (content[start] !== "<") return null;
6066
6057
  let cursor = start + 1;
6067
6058
  const isClosing = content[cursor] === "/";
6068
6059
  if (isClosing) cursor++;