@iyulab/chat-components 0.17.0 → 0.17.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/CHANGELOG.md +10 -0
- package/dist/node_modules/katex/dist/katex.js +139 -75
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.17.1] - 2026-10-05
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- **KaTeX 0.19** (was 0.18). Math renders as before. KaTeX now reports a character it has no metrics
|
|
8
|
+
for through its `strict` option (code `symbolNotInFont`): with the default `strict: "warn"` it is a
|
|
9
|
+
console warning, with `strict: "error"` it is a render error — set `strict` in the markdown math
|
|
10
|
+
options if you rely on either. A `strict` callback that returns nothing now warns; return `false`
|
|
11
|
+
or `"ignore"` to stay quiet.
|
|
12
|
+
|
|
3
13
|
## [0.17.0] - 2026-10-05
|
|
4
14
|
|
|
5
15
|
### Added
|
|
@@ -246,43 +246,6 @@ var Settings = class {
|
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
248
|
/**
|
|
249
|
-
* Report nonstrict (non-LaTeX-compatible) input.
|
|
250
|
-
* Can safely not be called if `this.strict` is false in JavaScript.
|
|
251
|
-
*/
|
|
252
|
-
reportNonstrict(errorCode, errorMsg, token) {
|
|
253
|
-
var strict = this.strict;
|
|
254
|
-
if (typeof strict === "function") strict = strict(errorCode, errorMsg, token);
|
|
255
|
-
if (!strict || strict === "ignore") return;
|
|
256
|
-
else if (strict === true || strict === "error") throw new ParseError("LaTeX-incompatible input and strict mode is set to 'error': " + (errorMsg + " [" + errorCode + "]"), token);
|
|
257
|
-
else if (strict === "warn") typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + (errorMsg + " [" + errorCode + "]"));
|
|
258
|
-
else typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to " + ("unrecognized '" + strict + "': " + errorMsg + " [" + errorCode + "]"));
|
|
259
|
-
}
|
|
260
|
-
/**
|
|
261
|
-
* Check whether to apply strict (LaTeX-adhering) behavior for unusual
|
|
262
|
-
* input (like `\\`). Unlike `nonstrict`, will not throw an error;
|
|
263
|
-
* instead, "error" translates to a return value of `true`, while "ignore"
|
|
264
|
-
* translates to a return value of `false`. May still print a warning:
|
|
265
|
-
* "warn" prints a warning and returns `false`.
|
|
266
|
-
* This is for the second category of `errorCode`s listed in the README.
|
|
267
|
-
*/
|
|
268
|
-
useStrictBehavior(errorCode, errorMsg, token) {
|
|
269
|
-
var strict = this.strict;
|
|
270
|
-
if (typeof strict === "function") try {
|
|
271
|
-
strict = strict(errorCode, errorMsg, token);
|
|
272
|
-
} catch (error) {
|
|
273
|
-
strict = "error";
|
|
274
|
-
}
|
|
275
|
-
if (!strict || strict === "ignore") return false;
|
|
276
|
-
else if (strict === true || strict === "error") return true;
|
|
277
|
-
else if (strict === "warn") {
|
|
278
|
-
typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + (errorMsg + " [" + errorCode + "]"));
|
|
279
|
-
return false;
|
|
280
|
-
} else {
|
|
281
|
-
typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to " + ("unrecognized '" + strict + "': " + errorMsg + " [" + errorCode + "]"));
|
|
282
|
-
return false;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
/**
|
|
286
249
|
* Check whether to test potentially dangerous input, and return
|
|
287
250
|
* `true` (trusted) or `false` (untrusted). The sole argument `context`
|
|
288
251
|
* should be an object with `command` field specifying the relevant LaTeX
|
|
@@ -16588,6 +16551,34 @@ var wideCharacterFont = (wideChar) => {
|
|
|
16588
16551
|
else if (120486 < codePoint && codePoint < 120782) return noFont;
|
|
16589
16552
|
else throw new ParseError("Unsupported character: " + wideChar);
|
|
16590
16553
|
};
|
|
16554
|
+
function handleStrict(params) {
|
|
16555
|
+
var strict = params.strict, errorCode = params.errorCode, errorMsg = params.errorMsg, token = params.token, report = params.report;
|
|
16556
|
+
var behavior = strict;
|
|
16557
|
+
if (typeof strict === "function") {
|
|
16558
|
+
if (report) behavior = strict(errorCode, errorMsg, token);
|
|
16559
|
+
else try {
|
|
16560
|
+
behavior = strict(errorCode, errorMsg, token);
|
|
16561
|
+
} catch (error) {
|
|
16562
|
+
behavior = "error";
|
|
16563
|
+
}
|
|
16564
|
+
}
|
|
16565
|
+
switch (behavior) {
|
|
16566
|
+
case true:
|
|
16567
|
+
case "error": if (report) throw new ParseError("LaTeX-incompatible input and strict mode is set to 'error': " + (errorMsg + " [" + errorCode + "]"), token);
|
|
16568
|
+
else return true;
|
|
16569
|
+
case false:
|
|
16570
|
+
case "ignore":
|
|
16571
|
+
if (!report) return false;
|
|
16572
|
+
break;
|
|
16573
|
+
default:
|
|
16574
|
+
typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + (errorMsg + " [" + errorCode + "]"));
|
|
16575
|
+
if (!report) return false;
|
|
16576
|
+
}
|
|
16577
|
+
}
|
|
16578
|
+
/**
|
|
16579
|
+
* This module contains general functions that can be used for building
|
|
16580
|
+
* different kinds of domTree nodes in a consistent manner.
|
|
16581
|
+
*/
|
|
16591
16582
|
/**
|
|
16592
16583
|
* Looks up the given symbol in fontMetrics, after applying any symbol
|
|
16593
16584
|
* replacements defined in symbol.js
|
|
@@ -16610,7 +16601,6 @@ var lookupSymbol = function lookupSymbol(value, fontName, mode) {
|
|
|
16610
16601
|
* TODO: make argument order closer to makeSpan
|
|
16611
16602
|
* TODO: add a separate argument for math class (e.g. `mop`, `mbin`), which
|
|
16612
16603
|
* should if present come first in `classes`.
|
|
16613
|
-
* TODO(#953): Make `options` mandatory and always pass it in.
|
|
16614
16604
|
*/
|
|
16615
16605
|
var makeSymbol = function makeSymbol(value, fontName, mode, options, classes) {
|
|
16616
16606
|
var lookup = lookupSymbol(value, fontName, mode);
|
|
@@ -16622,15 +16612,18 @@ var makeSymbol = function makeSymbol(value, fontName, mode, options, classes) {
|
|
|
16622
16612
|
if (mode === "text" || options && options.font === "mathit") italic = 0;
|
|
16623
16613
|
symbolNode = new SymbolNode(value, metrics.height, metrics.depth, italic, metrics.skew, metrics.width, classes);
|
|
16624
16614
|
} else {
|
|
16625
|
-
|
|
16615
|
+
handleStrict({
|
|
16616
|
+
strict: options.strict,
|
|
16617
|
+
errorCode: "symbolNotInFont",
|
|
16618
|
+
errorMsg: "No character metrics for '" + value + "' in style '" + fontName + "' and mode '" + mode + "'",
|
|
16619
|
+
report: true
|
|
16620
|
+
});
|
|
16626
16621
|
symbolNode = new SymbolNode(value, 0, 0, 0, 0, 0, classes);
|
|
16627
16622
|
}
|
|
16628
|
-
|
|
16629
|
-
|
|
16630
|
-
|
|
16631
|
-
|
|
16632
|
-
if (color) symbolNode.style.color = color;
|
|
16633
|
-
}
|
|
16623
|
+
symbolNode.maxFontSize = options.sizeMultiplier;
|
|
16624
|
+
if (options.style.isTight()) symbolNode.classes.push("mtight");
|
|
16625
|
+
var color = options.getColor();
|
|
16626
|
+
if (color) symbolNode.style.color = color;
|
|
16634
16627
|
return symbolNode;
|
|
16635
16628
|
};
|
|
16636
16629
|
/**
|
|
@@ -17809,6 +17802,7 @@ var Options = class Options {
|
|
|
17809
17802
|
this.maxSize = void 0;
|
|
17810
17803
|
this.minRuleThickness = void 0;
|
|
17811
17804
|
this._fontMetrics = void 0;
|
|
17805
|
+
this.strict = void 0;
|
|
17812
17806
|
this.style = data.style;
|
|
17813
17807
|
this.color = data.color;
|
|
17814
17808
|
this.size = data.size || Options.BASESIZE;
|
|
@@ -17821,6 +17815,7 @@ var Options = class Options {
|
|
|
17821
17815
|
this.sizeMultiplier = sizeMultipliers[this.size - 1];
|
|
17822
17816
|
this.maxSize = data.maxSize;
|
|
17823
17817
|
this.minRuleThickness = data.minRuleThickness;
|
|
17818
|
+
this.strict = data.strict;
|
|
17824
17819
|
this._fontMetrics = void 0;
|
|
17825
17820
|
}
|
|
17826
17821
|
/**
|
|
@@ -17839,7 +17834,8 @@ var Options = class Options {
|
|
|
17839
17834
|
fontWeight: this.fontWeight,
|
|
17840
17835
|
fontShape: this.fontShape,
|
|
17841
17836
|
maxSize: this.maxSize,
|
|
17842
|
-
minRuleThickness: this.minRuleThickness
|
|
17837
|
+
minRuleThickness: this.minRuleThickness,
|
|
17838
|
+
strict: this.strict
|
|
17843
17839
|
};
|
|
17844
17840
|
Object.assign(data, extension);
|
|
17845
17841
|
return new Options(data);
|
|
@@ -17999,13 +17995,12 @@ var Options = class Options {
|
|
|
17999
17995
|
* The base size index.
|
|
18000
17996
|
*/
|
|
18001
17997
|
Options.BASESIZE = 6;
|
|
18002
|
-
var optionsFromSettings =
|
|
18003
|
-
|
|
18004
|
-
|
|
18005
|
-
|
|
18006
|
-
|
|
18007
|
-
|
|
18008
|
-
};
|
|
17998
|
+
var optionsFromSettings = (settings) => new Options({
|
|
17999
|
+
style: settings.displayMode ? Style$1.DISPLAY : Style$1.TEXT,
|
|
18000
|
+
maxSize: settings.maxSize,
|
|
18001
|
+
minRuleThickness: settings.minRuleThickness,
|
|
18002
|
+
strict: settings.strict
|
|
18003
|
+
});
|
|
18009
18004
|
var displayWrap = function displayWrap(node, settings) {
|
|
18010
18005
|
if (settings.displayMode) {
|
|
18011
18006
|
var classes = ["katex-display"];
|
|
@@ -18023,7 +18018,7 @@ var buildTree = function buildTree(tree, expression, settings) {
|
|
|
18023
18018
|
else katexNode = makeSpan(["katex"], [buildMathML(tree, expression, options, settings.displayMode, false), buildHTML(tree, options)]);
|
|
18024
18019
|
return displayWrap(katexNode, settings);
|
|
18025
18020
|
};
|
|
18026
|
-
var buildHTMLTree = function buildHTMLTree(tree,
|
|
18021
|
+
var buildHTMLTree = function buildHTMLTree(tree, settings) {
|
|
18027
18022
|
return displayWrap(makeSpan(["katex"], [buildHTML(tree, optionsFromSettings(settings))]), settings);
|
|
18028
18023
|
};
|
|
18029
18024
|
/**
|
|
@@ -18759,7 +18754,12 @@ defineFunction({
|
|
|
18759
18754
|
var base = args[0];
|
|
18760
18755
|
var mode = context.parser.mode;
|
|
18761
18756
|
if (mode === "math") {
|
|
18762
|
-
|
|
18757
|
+
handleStrict({
|
|
18758
|
+
strict: context.parser.settings.strict,
|
|
18759
|
+
errorCode: "mathVsTextAccents",
|
|
18760
|
+
errorMsg: "LaTeX's accent " + context.funcName + " works only in text mode",
|
|
18761
|
+
report: true
|
|
18762
|
+
});
|
|
18763
18763
|
mode = "text";
|
|
18764
18764
|
}
|
|
18765
18765
|
return {
|
|
@@ -19371,10 +19371,15 @@ defineFunction({
|
|
|
19371
19371
|
numArgs: 0,
|
|
19372
19372
|
numOptionalArgs: 0,
|
|
19373
19373
|
allowedInText: true,
|
|
19374
|
-
handler(_ref
|
|
19374
|
+
handler(_ref) {
|
|
19375
19375
|
var parser = _ref.parser;
|
|
19376
19376
|
var size = parser.gullet.future().text === "[" ? parser.parseSizeGroup(true) : null;
|
|
19377
|
-
var newLine = !parser.settings.displayMode || !
|
|
19377
|
+
var newLine = !parser.settings.displayMode || !handleStrict({
|
|
19378
|
+
strict: parser.settings.strict,
|
|
19379
|
+
errorCode: "newLineInDisplayMode",
|
|
19380
|
+
errorMsg: "In LaTeX, \\\\ or \\newline does nothing in display mode",
|
|
19381
|
+
report: false
|
|
19382
|
+
});
|
|
19378
19383
|
return {
|
|
19379
19384
|
type: "cr",
|
|
19380
19385
|
mode: parser.mode,
|
|
@@ -19625,13 +19630,13 @@ var makeLargeDelim = function makeLargeDelim(delim, size, center, options, mode,
|
|
|
19625
19630
|
* Make a span from a font glyph with the given offset and in the given font.
|
|
19626
19631
|
* This is used in makeStackedDelim to make the stacking pieces for the delimiter.
|
|
19627
19632
|
*/
|
|
19628
|
-
var makeGlyphSpan = function makeGlyphSpan(symbol, font, mode) {
|
|
19633
|
+
var makeGlyphSpan = function makeGlyphSpan(symbol, font, mode, options) {
|
|
19629
19634
|
var sizeClass;
|
|
19630
19635
|
if (font === "Size1-Regular") sizeClass = "delim-size1";
|
|
19631
19636
|
else sizeClass = "delim-size4";
|
|
19632
19637
|
return {
|
|
19633
19638
|
type: "elem",
|
|
19634
|
-
elem: makeSpan(["delimsizinginner", sizeClass], [makeSpan([], [makeSymbol(symbol, font, mode)])])
|
|
19639
|
+
elem: makeSpan(["delimsizinginner", sizeClass], [makeSpan([], [makeSymbol(symbol, font, mode, options)])])
|
|
19635
19640
|
};
|
|
19636
19641
|
};
|
|
19637
19642
|
var makeInner = function makeInner(ch, height, options) {
|
|
@@ -19826,7 +19831,7 @@ var makeStackedDelim = function makeStackedDelim(delim, heightTotal, center, opt
|
|
|
19826
19831
|
elem: wrapper
|
|
19827
19832
|
});
|
|
19828
19833
|
} else {
|
|
19829
|
-
stack.push(makeGlyphSpan(bottom, font, mode));
|
|
19834
|
+
stack.push(makeGlyphSpan(bottom, font, mode, options));
|
|
19830
19835
|
stack.push(lap);
|
|
19831
19836
|
if (middle === null) {
|
|
19832
19837
|
var innerHeight = realHeightTotal - topHeightTotal - bottomHeightTotal + 2 * lapInEms;
|
|
@@ -19835,12 +19840,12 @@ var makeStackedDelim = function makeStackedDelim(delim, heightTotal, center, opt
|
|
|
19835
19840
|
var _innerHeight = (realHeightTotal - topHeightTotal - bottomHeightTotal - middleHeightTotal) / 2 + 2 * lapInEms;
|
|
19836
19841
|
stack.push(makeInner(repeat, _innerHeight, options));
|
|
19837
19842
|
stack.push(lap);
|
|
19838
|
-
stack.push(makeGlyphSpan(middle, font, mode));
|
|
19843
|
+
stack.push(makeGlyphSpan(middle, font, mode, options));
|
|
19839
19844
|
stack.push(lap);
|
|
19840
19845
|
stack.push(makeInner(repeat, _innerHeight, options));
|
|
19841
19846
|
}
|
|
19842
19847
|
stack.push(lap);
|
|
19843
|
-
stack.push(makeGlyphSpan(top, font, mode));
|
|
19848
|
+
stack.push(makeGlyphSpan(top, font, mode, options));
|
|
19844
19849
|
}
|
|
19845
19850
|
var newOptions = options.havingBaseStyle(Style$1.TEXT);
|
|
19846
19851
|
return styleWrap(makeSpan(["delimsizing", "mult"], [makeVList({
|
|
@@ -20649,7 +20654,12 @@ defineFunction({
|
|
|
20649
20654
|
allowedInText: true,
|
|
20650
20655
|
handler(_ref5, args) {
|
|
20651
20656
|
var parser = _ref5.parser, funcName = _ref5.funcName;
|
|
20652
|
-
if (parser.mode === "math")
|
|
20657
|
+
if (parser.mode === "math") handleStrict({
|
|
20658
|
+
strict: parser.settings.strict,
|
|
20659
|
+
errorCode: "mathVsSout",
|
|
20660
|
+
errorMsg: "LaTeX's \\sout works only in text mode",
|
|
20661
|
+
report: true
|
|
20662
|
+
});
|
|
20653
20663
|
var body = args[0];
|
|
20654
20664
|
return {
|
|
20655
20665
|
type: "enclose",
|
|
@@ -20841,7 +20851,12 @@ function parseArray(parser, _ref, style) {
|
|
|
20841
20851
|
if (next === "&") {
|
|
20842
20852
|
if (maxNumCols && row.length === maxNumCols) {
|
|
20843
20853
|
if (singleRow || colSeparationType) throw new ParseError("Too many tab characters: &", parser.nextToken);
|
|
20844
|
-
else
|
|
20854
|
+
else handleStrict({
|
|
20855
|
+
strict: parser.settings.strict,
|
|
20856
|
+
errorCode: "textEnv",
|
|
20857
|
+
errorMsg: "Too few columns specified in the {array} column argument.",
|
|
20858
|
+
report: true
|
|
20859
|
+
});
|
|
20845
20860
|
}
|
|
20846
20861
|
parser.consume();
|
|
20847
20862
|
} else if (next === "\\end") {
|
|
@@ -22198,7 +22213,12 @@ defineFunction({
|
|
|
22198
22213
|
_ref.token;
|
|
22199
22214
|
var value = assertNodeType(args[0], "raw").string;
|
|
22200
22215
|
var body = args[1];
|
|
22201
|
-
if (parser.settings.strict)
|
|
22216
|
+
if (parser.settings.strict) handleStrict({
|
|
22217
|
+
strict: parser.settings.strict,
|
|
22218
|
+
errorCode: "htmlExtension",
|
|
22219
|
+
errorMsg: "HTML extension is disabled on strict mode",
|
|
22220
|
+
report: true
|
|
22221
|
+
});
|
|
22202
22222
|
var trustContext;
|
|
22203
22223
|
var attributes = {};
|
|
22204
22224
|
switch (funcName) {
|
|
@@ -22428,9 +22448,24 @@ defineFunction({
|
|
|
22428
22448
|
var mathFunction = funcName[1] === "m";
|
|
22429
22449
|
var muUnit = size.value.unit === "mu";
|
|
22430
22450
|
if (mathFunction) {
|
|
22431
|
-
if (!muUnit)
|
|
22432
|
-
|
|
22433
|
-
|
|
22451
|
+
if (!muUnit) handleStrict({
|
|
22452
|
+
strict: parser.settings.strict,
|
|
22453
|
+
errorCode: "mathVsTextUnits",
|
|
22454
|
+
errorMsg: "LaTeX's " + funcName + " supports only mu units, " + ("not " + size.value.unit + " units"),
|
|
22455
|
+
report: true
|
|
22456
|
+
});
|
|
22457
|
+
if (parser.mode !== "math") handleStrict({
|
|
22458
|
+
strict: parser.settings.strict,
|
|
22459
|
+
errorCode: "mathVsTextUnits",
|
|
22460
|
+
errorMsg: "LaTeX's " + funcName + " works only in math mode",
|
|
22461
|
+
report: true
|
|
22462
|
+
});
|
|
22463
|
+
} else if (muUnit) handleStrict({
|
|
22464
|
+
strict: parser.settings.strict,
|
|
22465
|
+
errorCode: "mathVsTextUnits",
|
|
22466
|
+
errorMsg: "LaTeX's " + funcName + " doesn't support mu units",
|
|
22467
|
+
report: true
|
|
22468
|
+
});
|
|
22434
22469
|
}
|
|
22435
22470
|
return {
|
|
22436
22471
|
type: "kern",
|
|
@@ -23961,7 +23996,12 @@ var Lexer = class {
|
|
|
23961
23996
|
var nlIndex = input.indexOf("\n", this.tokenRegex.lastIndex);
|
|
23962
23997
|
if (nlIndex === -1) {
|
|
23963
23998
|
this.tokenRegex.lastIndex = input.length;
|
|
23964
|
-
|
|
23999
|
+
handleStrict({
|
|
24000
|
+
strict: this.settings.strict,
|
|
24001
|
+
errorCode: "commentAtEnd",
|
|
24002
|
+
errorMsg: "% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)",
|
|
24003
|
+
report: true
|
|
24004
|
+
});
|
|
23965
24005
|
} else this.tokenRegex.lastIndex = nlIndex + 1;
|
|
23966
24006
|
return this.lex();
|
|
23967
24007
|
}
|
|
@@ -26123,7 +26163,13 @@ var Parser = class Parser {
|
|
|
26123
26163
|
};
|
|
26124
26164
|
}
|
|
26125
26165
|
if (Object.prototype.hasOwnProperty.call(unicodeSymbols, text[0]) && !symbols[this.mode][text[0]]) {
|
|
26126
|
-
if (this.settings.strict && this.mode === "math")
|
|
26166
|
+
if (this.settings.strict && this.mode === "math") handleStrict({
|
|
26167
|
+
strict: this.settings.strict,
|
|
26168
|
+
errorCode: "unicodeTextInMathMode",
|
|
26169
|
+
errorMsg: "Accented Unicode text character \"" + text[0] + "\" used in math mode",
|
|
26170
|
+
report: true,
|
|
26171
|
+
token: nucleus
|
|
26172
|
+
});
|
|
26127
26173
|
text = unicodeSymbols[text[0]] + text.slice(1);
|
|
26128
26174
|
}
|
|
26129
26175
|
var match = combiningDiacriticalMarksEndRegex.exec(text);
|
|
@@ -26134,7 +26180,13 @@ var Parser = class Parser {
|
|
|
26134
26180
|
}
|
|
26135
26181
|
var symbol;
|
|
26136
26182
|
if (symbols[this.mode][text]) {
|
|
26137
|
-
if (this.settings.strict && this.mode === "math" && extraLatin.includes(text))
|
|
26183
|
+
if (this.settings.strict && this.mode === "math" && extraLatin.includes(text)) handleStrict({
|
|
26184
|
+
strict: this.settings.strict,
|
|
26185
|
+
errorCode: "unicodeTextInMathMode",
|
|
26186
|
+
errorMsg: "Latin-1/Unicode text character \"" + text[0] + "\" used in math mode",
|
|
26187
|
+
report: true,
|
|
26188
|
+
token: nucleus
|
|
26189
|
+
});
|
|
26138
26190
|
var group = symbols[this.mode][text].group;
|
|
26139
26191
|
var loc = SourceLocation.range(nucleus);
|
|
26140
26192
|
var s;
|
|
@@ -26154,8 +26206,20 @@ var Parser = class Parser {
|
|
|
26154
26206
|
symbol = s;
|
|
26155
26207
|
} else if (text.charCodeAt(0) >= 128) {
|
|
26156
26208
|
if (this.settings.strict) {
|
|
26157
|
-
if (!supportedCodepoint(text.charCodeAt(0)))
|
|
26158
|
-
|
|
26209
|
+
if (!supportedCodepoint(text.charCodeAt(0))) handleStrict({
|
|
26210
|
+
strict: this.settings.strict,
|
|
26211
|
+
errorCode: "unknownSymbol",
|
|
26212
|
+
errorMsg: "Unrecognized Unicode character \"" + text[0] + "\"" + (" (" + text.charCodeAt(0) + ")"),
|
|
26213
|
+
report: true,
|
|
26214
|
+
token: nucleus
|
|
26215
|
+
});
|
|
26216
|
+
else if (this.mode === "math") handleStrict({
|
|
26217
|
+
strict: this.settings.strict,
|
|
26218
|
+
errorCode: "unicodeTextInMathMode",
|
|
26219
|
+
errorMsg: "Unicode text character \"" + text[0] + "\" used in math mode",
|
|
26220
|
+
report: true,
|
|
26221
|
+
token: nucleus
|
|
26222
|
+
});
|
|
26159
26223
|
}
|
|
26160
26224
|
symbol = {
|
|
26161
26225
|
type: "textord",
|
|
@@ -26271,12 +26335,12 @@ var renderToDomTree = function renderToDomTree(expression, options) {
|
|
|
26271
26335
|
var renderToHTMLTree = function renderToHTMLTree(expression, options) {
|
|
26272
26336
|
var settings = new Settings(options);
|
|
26273
26337
|
try {
|
|
26274
|
-
return buildHTMLTree(parseTree(expression, settings),
|
|
26338
|
+
return buildHTMLTree(parseTree(expression, settings), settings);
|
|
26275
26339
|
} catch (error) {
|
|
26276
26340
|
return renderError(error, expression, settings);
|
|
26277
26341
|
}
|
|
26278
26342
|
};
|
|
26279
|
-
var version = "0.
|
|
26343
|
+
var version = "0.19.0";
|
|
26280
26344
|
var __domTree = {
|
|
26281
26345
|
Span,
|
|
26282
26346
|
Anchor,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iyulab/chat-components",
|
|
3
3
|
"description": "llm chat components for building chat interfaces",
|
|
4
|
-
"version": "0.17.
|
|
4
|
+
"version": "0.17.1",
|
|
5
5
|
"author": "iyulab",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"keywords": [
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"preversion": "node -e \"if(require('fs').existsSync('../../scripts/preversion-check.mjs'))require('child_process').execFileSync('node',['../../scripts/preversion-check.mjs'],{stdio:'inherit'})\"",
|
|
57
57
|
"start": "vite",
|
|
58
58
|
"build": "npm run typecheck && eslint && vite build",
|
|
59
|
+
"pretest": "node -e \"if(require('fs').existsSync('../../scripts/sibling-dist-check.js'))require('child_process').execFileSync('node',['../../scripts/sibling-dist-check.js'],{stdio:'inherit'})\"",
|
|
59
60
|
"test": "vitest run",
|
|
60
61
|
"test:watch": "vitest",
|
|
61
62
|
"lint": "eslint src/",
|
|
@@ -64,7 +65,7 @@
|
|
|
64
65
|
},
|
|
65
66
|
"dependencies": {
|
|
66
67
|
"highlight.js": "^11.11.1",
|
|
67
|
-
"katex": "^0.
|
|
68
|
+
"katex": "^0.19.0",
|
|
68
69
|
"lit": "^3.3.3",
|
|
69
70
|
"marked": "^18.0.6"
|
|
70
71
|
},
|