@ai-matrx/content-ir 0.19.18 → 0.19.19
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 +5 -0
- package/dist/index.cjs +7 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/source.cjs +7 -0
- package/dist/source.cjs.map +1 -1
- package/dist/source.d.cts +6 -1
- package/dist/source.d.ts +6 -1
- package/dist/source.js +7 -1
- package/dist/source.js.map +1 -1
- package/package.json +1 -1
package/dist/source.d.cts
CHANGED
|
@@ -678,6 +678,11 @@ declare function splitRowSegments(line: string): string[];
|
|
|
678
678
|
declare function rowCells(line: string): string[];
|
|
679
679
|
/** GFM's table-level unescape: a cell's `\|` is a pipe, in code spans too. */
|
|
680
680
|
declare function unescapeCellPipes(cell: string): string;
|
|
681
|
+
/**
|
|
682
|
+
* The trimmed line opens an HTML block whose element every sanitizer strips: the
|
|
683
|
+
* block ends at this line (the one deliberate GFM deviation, above).
|
|
684
|
+
*/
|
|
685
|
+
declare function opensStrippedHtmlBlock(trimmed: string): boolean;
|
|
681
686
|
/**
|
|
682
687
|
* A tag name CommonMark reads as an HTML BLOCK when it opens a line (conditions
|
|
683
688
|
* 1 and 6: `div`, `details`, `section`, `script`, …; case-insensitive). A
|
|
@@ -726,4 +731,4 @@ declare function findTableStart(lines: readonly string[], from?: number): number
|
|
|
726
731
|
/** Index just past the table whose header is at `start` (header, delimiter, then continuation rows). */
|
|
727
732
|
declare function findTableEnd(lines: readonly string[], start: number): number;
|
|
728
733
|
|
|
729
|
-
export { AFTER_WINDOW, BacktickRuns, type BlockIslandType, CALLOUT_NAMES, type CodePointIndex, type CodeRange, type DisturbedIsland, FENCE_OPENER_WHITESPACE, FENCE_WHITESPACE, type FenceEnd, type FenceLineKind, type FenceLines, type FenceOpener, FenceReader, type InlineIslandType, type InnerFenceLine, type IslandMeta, type IslandType, type LinkDefinition, type MapOptions, type MappedPosition, type MappedRange, NESTING_FENCE_LANGUAGES, type ReadXmlTag, type SourceBlock, type SourceBlockKind, type SourceChange, type SourceEdit, type SourceIsland, type SourceSpan, SourceSpliceError, type SourceSpliceErrorCode, type SpliceIntegrity, type SpliceOptions, type SpliceResult, type TokenizeOptions, XmlContainerTracker, blockAt, blockEdit, blockRangeEdit, buildCodePointIndex, classifyInnerFenceLine, closeFence, codeSpanText, collectLinkDefinitions, continuesTable, fenceLineKinds, fenceNestsInnerFences, fenceOpenerOf, fenceParts, findCodeRanges, findInlineCodeSpans, findLinkDefinitionLines, findTableEnd, findTableStart, isEscapedBracketMath, isGfmDelimiterRow, isHtmlBlockTagName, isMathPlaceholder, isPipeLedRow, isSingleDollarMath, islandEdit, joinSource, lineIndent, listIslands, looksLikeDisplayMath, looksLikeOpenInlineMath, mapCodeRanges, mapInlineCodeSpans, mapPosition, mapRange, normalizeLinkLabel, opensTable, pairDisplayMath, parseFenceOpener, pendingDisplayMathOpener, readXmlTag, resolveReferenceLinks, rowCells, singleDollarAfter, singleDollarMathEnd, spliceSave, splitRowSegments, splitsSurrogatePair, startsHtmlBlock, startsPipelessTable, tableContainerIndent, tableStartsAt, toCodePointOffset, toUtf16Offset, tokenizeSource, trimFenceLine, unescapeCellPipes };
|
|
734
|
+
export { AFTER_WINDOW, BacktickRuns, type BlockIslandType, CALLOUT_NAMES, type CodePointIndex, type CodeRange, type DisturbedIsland, FENCE_OPENER_WHITESPACE, FENCE_WHITESPACE, type FenceEnd, type FenceLineKind, type FenceLines, type FenceOpener, FenceReader, type InlineIslandType, type InnerFenceLine, type IslandMeta, type IslandType, type LinkDefinition, type MapOptions, type MappedPosition, type MappedRange, NESTING_FENCE_LANGUAGES, type ReadXmlTag, type SourceBlock, type SourceBlockKind, type SourceChange, type SourceEdit, type SourceIsland, type SourceSpan, SourceSpliceError, type SourceSpliceErrorCode, type SpliceIntegrity, type SpliceOptions, type SpliceResult, type TokenizeOptions, XmlContainerTracker, blockAt, blockEdit, blockRangeEdit, buildCodePointIndex, classifyInnerFenceLine, closeFence, codeSpanText, collectLinkDefinitions, continuesTable, fenceLineKinds, fenceNestsInnerFences, fenceOpenerOf, fenceParts, findCodeRanges, findInlineCodeSpans, findLinkDefinitionLines, findTableEnd, findTableStart, isEscapedBracketMath, isGfmDelimiterRow, isHtmlBlockTagName, isMathPlaceholder, isPipeLedRow, isSingleDollarMath, islandEdit, joinSource, lineIndent, listIslands, looksLikeDisplayMath, looksLikeOpenInlineMath, mapCodeRanges, mapInlineCodeSpans, mapPosition, mapRange, normalizeLinkLabel, opensStrippedHtmlBlock, opensTable, pairDisplayMath, parseFenceOpener, pendingDisplayMathOpener, readXmlTag, resolveReferenceLinks, rowCells, singleDollarAfter, singleDollarMathEnd, spliceSave, splitRowSegments, splitsSurrogatePair, startsHtmlBlock, startsPipelessTable, tableContainerIndent, tableStartsAt, toCodePointOffset, toUtf16Offset, tokenizeSource, trimFenceLine, unescapeCellPipes };
|
package/dist/source.d.ts
CHANGED
|
@@ -678,6 +678,11 @@ declare function splitRowSegments(line: string): string[];
|
|
|
678
678
|
declare function rowCells(line: string): string[];
|
|
679
679
|
/** GFM's table-level unescape: a cell's `\|` is a pipe, in code spans too. */
|
|
680
680
|
declare function unescapeCellPipes(cell: string): string;
|
|
681
|
+
/**
|
|
682
|
+
* The trimmed line opens an HTML block whose element every sanitizer strips: the
|
|
683
|
+
* block ends at this line (the one deliberate GFM deviation, above).
|
|
684
|
+
*/
|
|
685
|
+
declare function opensStrippedHtmlBlock(trimmed: string): boolean;
|
|
681
686
|
/**
|
|
682
687
|
* A tag name CommonMark reads as an HTML BLOCK when it opens a line (conditions
|
|
683
688
|
* 1 and 6: `div`, `details`, `section`, `script`, …; case-insensitive). A
|
|
@@ -726,4 +731,4 @@ declare function findTableStart(lines: readonly string[], from?: number): number
|
|
|
726
731
|
/** Index just past the table whose header is at `start` (header, delimiter, then continuation rows). */
|
|
727
732
|
declare function findTableEnd(lines: readonly string[], start: number): number;
|
|
728
733
|
|
|
729
|
-
export { AFTER_WINDOW, BacktickRuns, type BlockIslandType, CALLOUT_NAMES, type CodePointIndex, type CodeRange, type DisturbedIsland, FENCE_OPENER_WHITESPACE, FENCE_WHITESPACE, type FenceEnd, type FenceLineKind, type FenceLines, type FenceOpener, FenceReader, type InlineIslandType, type InnerFenceLine, type IslandMeta, type IslandType, type LinkDefinition, type MapOptions, type MappedPosition, type MappedRange, NESTING_FENCE_LANGUAGES, type ReadXmlTag, type SourceBlock, type SourceBlockKind, type SourceChange, type SourceEdit, type SourceIsland, type SourceSpan, SourceSpliceError, type SourceSpliceErrorCode, type SpliceIntegrity, type SpliceOptions, type SpliceResult, type TokenizeOptions, XmlContainerTracker, blockAt, blockEdit, blockRangeEdit, buildCodePointIndex, classifyInnerFenceLine, closeFence, codeSpanText, collectLinkDefinitions, continuesTable, fenceLineKinds, fenceNestsInnerFences, fenceOpenerOf, fenceParts, findCodeRanges, findInlineCodeSpans, findLinkDefinitionLines, findTableEnd, findTableStart, isEscapedBracketMath, isGfmDelimiterRow, isHtmlBlockTagName, isMathPlaceholder, isPipeLedRow, isSingleDollarMath, islandEdit, joinSource, lineIndent, listIslands, looksLikeDisplayMath, looksLikeOpenInlineMath, mapCodeRanges, mapInlineCodeSpans, mapPosition, mapRange, normalizeLinkLabel, opensTable, pairDisplayMath, parseFenceOpener, pendingDisplayMathOpener, readXmlTag, resolveReferenceLinks, rowCells, singleDollarAfter, singleDollarMathEnd, spliceSave, splitRowSegments, splitsSurrogatePair, startsHtmlBlock, startsPipelessTable, tableContainerIndent, tableStartsAt, toCodePointOffset, toUtf16Offset, tokenizeSource, trimFenceLine, unescapeCellPipes };
|
|
734
|
+
export { AFTER_WINDOW, BacktickRuns, type BlockIslandType, CALLOUT_NAMES, type CodePointIndex, type CodeRange, type DisturbedIsland, FENCE_OPENER_WHITESPACE, FENCE_WHITESPACE, type FenceEnd, type FenceLineKind, type FenceLines, type FenceOpener, FenceReader, type InlineIslandType, type InnerFenceLine, type IslandMeta, type IslandType, type LinkDefinition, type MapOptions, type MappedPosition, type MappedRange, NESTING_FENCE_LANGUAGES, type ReadXmlTag, type SourceBlock, type SourceBlockKind, type SourceChange, type SourceEdit, type SourceIsland, type SourceSpan, SourceSpliceError, type SourceSpliceErrorCode, type SpliceIntegrity, type SpliceOptions, type SpliceResult, type TokenizeOptions, XmlContainerTracker, blockAt, blockEdit, blockRangeEdit, buildCodePointIndex, classifyInnerFenceLine, closeFence, codeSpanText, collectLinkDefinitions, continuesTable, fenceLineKinds, fenceNestsInnerFences, fenceOpenerOf, fenceParts, findCodeRanges, findInlineCodeSpans, findLinkDefinitionLines, findTableEnd, findTableStart, isEscapedBracketMath, isGfmDelimiterRow, isHtmlBlockTagName, isMathPlaceholder, isPipeLedRow, isSingleDollarMath, islandEdit, joinSource, lineIndent, listIslands, looksLikeDisplayMath, looksLikeOpenInlineMath, mapCodeRanges, mapInlineCodeSpans, mapPosition, mapRange, normalizeLinkLabel, opensStrippedHtmlBlock, opensTable, pairDisplayMath, parseFenceOpener, pendingDisplayMathOpener, readXmlTag, resolveReferenceLinks, rowCells, singleDollarAfter, singleDollarMathEnd, spliceSave, splitRowSegments, splitsSurrogatePair, startsHtmlBlock, startsPipelessTable, tableContainerIndent, tableStartsAt, toCodePointOffset, toUtf16Offset, tokenizeSource, trimFenceLine, unescapeCellPipes };
|
package/dist/source.js
CHANGED
|
@@ -1033,6 +1033,11 @@ var HTML_BLOCK_NAMES = "address|article|aside|base|basefont|blockquote|body|capt
|
|
|
1033
1033
|
var HTML_BLOCK_TAG = new RegExp(`^</?(?:${HTML_BLOCK_NAMES})(?:[\\s>]|/>|$)`, "i");
|
|
1034
1034
|
var ATTRIBUTE = `\\s+[A-Za-z_:][A-Za-z0-9_.:-]*(?:\\s*=\\s*(?:[^\\s"'=<>\`]+|'[^']*'|"[^"]*"))?`;
|
|
1035
1035
|
var HTML_COMPLETE_TAG = new RegExp(`^(?:<[A-Za-z][A-Za-z0-9-]*(?:${ATTRIBUTE})*\\s*/?>|</[A-Za-z][A-Za-z0-9-]*\\s*>)\\s*$`);
|
|
1036
|
+
var STRIPPED_HTML_BLOCK_NAMES = "address|article|aside|base|basefont|body|center|dialog|dir|fieldset|footer|form|frame|frameset|head|header|html|iframe|legend|link|main|menu|menuitem|nav|noframes|optgroup|option|param|search|title|track";
|
|
1037
|
+
var STRIPPED_HTML_BLOCK_TAG = new RegExp(`^</?(?:${STRIPPED_HTML_BLOCK_NAMES})(?:[\\s>]|/>|$)`, "i");
|
|
1038
|
+
function opensStrippedHtmlBlock(trimmed) {
|
|
1039
|
+
return STRIPPED_HTML_BLOCK_TAG.test(trimmed);
|
|
1040
|
+
}
|
|
1036
1041
|
var HTML_BLOCK_NAME_SET = /* @__PURE__ */ new Set([
|
|
1037
1042
|
// Condition 1 (raw text) and condition 6 (block) tag names — CommonMark 0.31.
|
|
1038
1043
|
"script",
|
|
@@ -1150,6 +1155,7 @@ function insideHtmlBlock(lines, index) {
|
|
|
1150
1155
|
continue;
|
|
1151
1156
|
}
|
|
1152
1157
|
paragraph = false;
|
|
1158
|
+
if (opensStrippedHtmlBlock(trimmed)) continue;
|
|
1153
1159
|
open = end && end.test(trimmed.slice(2)) ? void 0 : end;
|
|
1154
1160
|
}
|
|
1155
1161
|
return open !== void 0;
|
|
@@ -2865,6 +2871,6 @@ function resolveReferenceLinks(fragment, defs) {
|
|
|
2865
2871
|
return resolved.replace(new RegExp(`${PLACEHOLDER}(\\d+)${PLACEHOLDER}`, "g"), (_m, i) => spans[Number(i)] ?? "");
|
|
2866
2872
|
}
|
|
2867
2873
|
|
|
2868
|
-
export { AFTER_WINDOW, BacktickRuns, CALLOUT_NAMES, FENCE_OPENER_WHITESPACE, FENCE_WHITESPACE, FenceReader, NESTING_FENCE_LANGUAGES, SourceSpliceError, XmlContainerTracker, blockAt, blockEdit, blockRangeEdit, buildCodePointIndex, classifyInnerFenceLine, closeFence, codeSpanText, collectLinkDefinitions, continuesTable, fenceLineKinds, fenceNestsInnerFences, fenceOpenerOf, fenceParts, findCodeRanges, findInlineCodeSpans, findLinkDefinitionLines, findTableEnd, findTableStart, isEscapedBracketMath, isGfmDelimiterRow, isHtmlBlockTagName, isMathPlaceholder, isPipeLedRow, isSingleDollarMath, islandEdit, joinSource, lineIndent, listIslands, looksLikeDisplayMath, looksLikeOpenInlineMath, mapCodeRanges, mapInlineCodeSpans, mapPosition, mapRange, normalizeLinkLabel, opensTable, pairDisplayMath, parseFenceOpener, pendingDisplayMathOpener, readXmlTag, resolveReferenceLinks, rowCells, singleDollarAfter, singleDollarMathEnd, spliceSave, splitRowSegments, splitsSurrogatePair, startsHtmlBlock, startsPipelessTable, tableContainerIndent, tableStartsAt, toCodePointOffset, toUtf16Offset, tokenizeSource, trimFenceLine, unescapeCellPipes };
|
|
2874
|
+
export { AFTER_WINDOW, BacktickRuns, CALLOUT_NAMES, FENCE_OPENER_WHITESPACE, FENCE_WHITESPACE, FenceReader, NESTING_FENCE_LANGUAGES, SourceSpliceError, XmlContainerTracker, blockAt, blockEdit, blockRangeEdit, buildCodePointIndex, classifyInnerFenceLine, closeFence, codeSpanText, collectLinkDefinitions, continuesTable, fenceLineKinds, fenceNestsInnerFences, fenceOpenerOf, fenceParts, findCodeRanges, findInlineCodeSpans, findLinkDefinitionLines, findTableEnd, findTableStart, isEscapedBracketMath, isGfmDelimiterRow, isHtmlBlockTagName, isMathPlaceholder, isPipeLedRow, isSingleDollarMath, islandEdit, joinSource, lineIndent, listIslands, looksLikeDisplayMath, looksLikeOpenInlineMath, mapCodeRanges, mapInlineCodeSpans, mapPosition, mapRange, normalizeLinkLabel, opensStrippedHtmlBlock, opensTable, pairDisplayMath, parseFenceOpener, pendingDisplayMathOpener, readXmlTag, resolveReferenceLinks, rowCells, singleDollarAfter, singleDollarMathEnd, spliceSave, splitRowSegments, splitsSurrogatePair, startsHtmlBlock, startsPipelessTable, tableContainerIndent, tableStartsAt, toCodePointOffset, toUtf16Offset, tokenizeSource, trimFenceLine, unescapeCellPipes };
|
|
2869
2875
|
//# sourceMappingURL=source.js.map
|
|
2870
2876
|
//# sourceMappingURL=source.js.map
|