@ai-matrx/content-ir 0.19.6 → 0.19.8
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/CHANGELOG.md +11 -0
- package/dist/index.cjs +5 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -8
- package/dist/index.js.map +1 -1
- package/dist/source.cjs +5 -8
- package/dist/source.cjs.map +1 -1
- package/dist/source.d.cts +3 -1
- package/dist/source.d.ts +3 -1
- package/dist/source.js +5 -8
- package/dist/source.js.map +1 -1
- package/package.json +1 -1
package/dist/source.d.cts
CHANGED
|
@@ -457,7 +457,9 @@ declare const FENCE_OPENER_WHITESPACE = "\t\n\v\f\r \u00A0\u1680\u2000\u2001\u20
|
|
|
457
457
|
/**
|
|
458
458
|
* Parse a backtick fence OPENER line the way the renderer does: trim the line,
|
|
459
459
|
* count the backtick run (3+), trim the rest, and take the first
|
|
460
|
-
* whitespace-separated word as the language. null when the line opens nothing
|
|
460
|
+
* whitespace-separated word as the language. null when the line opens nothing —
|
|
461
|
+
* including when the info string holds a backtick (GFM / CommonMark 4.5:
|
|
462
|
+
* "```` code ````" and "``` `x` | b" are code spans, never fences).
|
|
461
463
|
*/
|
|
462
464
|
declare function parseFenceOpener(line: string): {
|
|
463
465
|
ticks: number;
|
package/dist/source.d.ts
CHANGED
|
@@ -457,7 +457,9 @@ declare const FENCE_OPENER_WHITESPACE = "\t\n\v\f\r \u00A0\u1680\u2000\u2001\u20
|
|
|
457
457
|
/**
|
|
458
458
|
* Parse a backtick fence OPENER line the way the renderer does: trim the line,
|
|
459
459
|
* count the backtick run (3+), trim the rest, and take the first
|
|
460
|
-
* whitespace-separated word as the language. null when the line opens nothing
|
|
460
|
+
* whitespace-separated word as the language. null when the line opens nothing —
|
|
461
|
+
* including when the info string holds a backtick (GFM / CommonMark 4.5:
|
|
462
|
+
* "```` code ````" and "``` `x` | b" are code spans, never fences).
|
|
461
463
|
*/
|
|
462
464
|
declare function parseFenceOpener(line: string): {
|
|
463
465
|
ticks: number;
|
package/dist/source.js
CHANGED
|
@@ -232,6 +232,7 @@ function parseFenceOpener(line) {
|
|
|
232
232
|
let ticks = 0;
|
|
233
233
|
while (start + ticks < end && line[start + ticks] === "`") ticks++;
|
|
234
234
|
if (ticks < 3) return null;
|
|
235
|
+
if (line.slice(start + ticks, end).includes("`")) return null;
|
|
235
236
|
let infoStart = start + ticks;
|
|
236
237
|
while (infoStart < end && isOpenerWhitespace(line[infoStart])) infoStart++;
|
|
237
238
|
let langEnd = infoStart;
|
|
@@ -256,9 +257,9 @@ function classifyInnerFenceLine(trimmed, openTicks, nests, nestedDepth) {
|
|
|
256
257
|
function fenceOpenerOf(content) {
|
|
257
258
|
const t = content.trimStart();
|
|
258
259
|
if (t.startsWith("```")) {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
return { char: "`", ticks, lang:
|
|
260
|
+
const parsed = parseFenceOpener(t);
|
|
261
|
+
if (!parsed) return null;
|
|
262
|
+
return { char: "`", ticks: parsed.ticks, lang: parsed.lang };
|
|
262
263
|
}
|
|
263
264
|
if (content.length - t.length <= 3 && t.startsWith("~~~")) {
|
|
264
265
|
const open = /^(~{3,})(.*)$/.exec(t);
|
|
@@ -268,11 +269,7 @@ function fenceOpenerOf(content) {
|
|
|
268
269
|
return null;
|
|
269
270
|
}
|
|
270
271
|
function opensStrictFence(line) {
|
|
271
|
-
|
|
272
|
-
if (!opener) return false;
|
|
273
|
-
if (opener.char === "~") return true;
|
|
274
|
-
const t = line.trimStart();
|
|
275
|
-
return !t.slice(opener.ticks).includes("`");
|
|
272
|
+
return fenceOpenerOf(line) !== null;
|
|
276
273
|
}
|
|
277
274
|
var FenceReader = class {
|
|
278
275
|
opener;
|