temml 0.10.20 → 0.10.21
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/temml.cjs +5 -22
- package/dist/temml.js +5 -22
- package/dist/temml.min.js +1 -1
- package/dist/temml.mjs +5 -22
- package/dist/temmlPostProcess.js +1 -1
- package/package.json +1 -1
- package/src/functions/color.js +2 -9
- package/src/functions/delimsizing.js +2 -12
- package/src/postProcess.js +1 -1
package/dist/temml.cjs
CHANGED
@@ -3247,7 +3247,7 @@ defineFunction({
|
|
3247
3247
|
allowedInText: true,
|
3248
3248
|
argTypes: ["raw", "raw"]
|
3249
3249
|
},
|
3250
|
-
handler({ parser, token }, args, optArgs) {
|
3250
|
+
handler({ parser, breakOnTokenText, token }, args, optArgs) {
|
3251
3251
|
const model = optArgs[0] && assertNodeType(optArgs[0], "raw").string;
|
3252
3252
|
let color = "";
|
3253
3253
|
if (model) {
|
@@ -3257,15 +3257,8 @@ defineFunction({
|
|
3257
3257
|
color = validateColor(assertNodeType(args[0], "raw").string, parser.gullet.macros, token);
|
3258
3258
|
}
|
3259
3259
|
|
3260
|
-
// Set macro \current@color in current namespace to store the current
|
3261
|
-
// color, mimicking the behavior of color.sty.
|
3262
|
-
// This is currently used just to correctly color a \right
|
3263
|
-
// that follows a \color command.
|
3264
|
-
parser.gullet.macros.set("\\current@color", color);
|
3265
|
-
|
3266
3260
|
// Parse out the implicit body that should be colored.
|
3267
|
-
|
3268
|
-
const body = parser.parseExpression(true, "\\color");
|
3261
|
+
const body = parser.parseExpression(true, breakOnTokenText);
|
3269
3262
|
|
3270
3263
|
return {
|
3271
3264
|
type: "color",
|
@@ -3805,18 +3798,10 @@ defineFunction({
|
|
3805
3798
|
argTypes: ["primitive"]
|
3806
3799
|
},
|
3807
3800
|
handler: (context, args) => {
|
3808
|
-
// \left case below triggers parsing of \right in
|
3809
|
-
// `const right = parser.parseFunction();`
|
3810
|
-
// uses this return value.
|
3811
|
-
const color = context.parser.gullet.macros.get("\\current@color");
|
3812
|
-
if (color && typeof color !== "string") {
|
3813
|
-
throw new ParseError("\\current@color set to non-string in \\right");
|
3814
|
-
}
|
3815
3801
|
return {
|
3816
3802
|
type: "leftright-right",
|
3817
3803
|
mode: context.parser.mode,
|
3818
|
-
delim: checkDelimiter(args[0], context).text
|
3819
|
-
color // undefined if not set via \color
|
3804
|
+
delim: checkDelimiter(args[0], context).text
|
3820
3805
|
};
|
3821
3806
|
}
|
3822
3807
|
});
|
@@ -3845,8 +3830,7 @@ defineFunction({
|
|
3845
3830
|
mode: parser.mode,
|
3846
3831
|
body,
|
3847
3832
|
left: delim.text,
|
3848
|
-
right: right.delim
|
3849
|
-
rightColor: right.color
|
3833
|
+
right: right.delim
|
3850
3834
|
};
|
3851
3835
|
},
|
3852
3836
|
mathmlBuilder: (group, style) => {
|
@@ -3869,7 +3853,6 @@ defineFunction({
|
|
3869
3853
|
if (group.right === "\u2216" || group.right.indexOf("arrow") > -1) {
|
3870
3854
|
rightNode.setAttribute("stretchy", "true");
|
3871
3855
|
}
|
3872
|
-
if (group.rightColor) { rightNode.style.color = group.rightColor; }
|
3873
3856
|
inner.push(rightNode);
|
3874
3857
|
|
3875
3858
|
return makeRow(inner);
|
@@ -13161,7 +13144,7 @@ class Style {
|
|
13161
13144
|
* https://mit-license.org/
|
13162
13145
|
*/
|
13163
13146
|
|
13164
|
-
const version = "0.10.
|
13147
|
+
const version = "0.10.21";
|
13165
13148
|
|
13166
13149
|
function postProcess(block) {
|
13167
13150
|
const labelMap = {};
|
package/dist/temml.js
CHANGED
@@ -3248,7 +3248,7 @@ var temml = (function () {
|
|
3248
3248
|
allowedInText: true,
|
3249
3249
|
argTypes: ["raw", "raw"]
|
3250
3250
|
},
|
3251
|
-
handler({ parser, token }, args, optArgs) {
|
3251
|
+
handler({ parser, breakOnTokenText, token }, args, optArgs) {
|
3252
3252
|
const model = optArgs[0] && assertNodeType(optArgs[0], "raw").string;
|
3253
3253
|
let color = "";
|
3254
3254
|
if (model) {
|
@@ -3258,15 +3258,8 @@ var temml = (function () {
|
|
3258
3258
|
color = validateColor(assertNodeType(args[0], "raw").string, parser.gullet.macros, token);
|
3259
3259
|
}
|
3260
3260
|
|
3261
|
-
// Set macro \current@color in current namespace to store the current
|
3262
|
-
// color, mimicking the behavior of color.sty.
|
3263
|
-
// This is currently used just to correctly color a \right
|
3264
|
-
// that follows a \color command.
|
3265
|
-
parser.gullet.macros.set("\\current@color", color);
|
3266
|
-
|
3267
3261
|
// Parse out the implicit body that should be colored.
|
3268
|
-
|
3269
|
-
const body = parser.parseExpression(true, "\\color");
|
3262
|
+
const body = parser.parseExpression(true, breakOnTokenText);
|
3270
3263
|
|
3271
3264
|
return {
|
3272
3265
|
type: "color",
|
@@ -3806,18 +3799,10 @@ var temml = (function () {
|
|
3806
3799
|
argTypes: ["primitive"]
|
3807
3800
|
},
|
3808
3801
|
handler: (context, args) => {
|
3809
|
-
// \left case below triggers parsing of \right in
|
3810
|
-
// `const right = parser.parseFunction();`
|
3811
|
-
// uses this return value.
|
3812
|
-
const color = context.parser.gullet.macros.get("\\current@color");
|
3813
|
-
if (color && typeof color !== "string") {
|
3814
|
-
throw new ParseError("\\current@color set to non-string in \\right");
|
3815
|
-
}
|
3816
3802
|
return {
|
3817
3803
|
type: "leftright-right",
|
3818
3804
|
mode: context.parser.mode,
|
3819
|
-
delim: checkDelimiter(args[0], context).text
|
3820
|
-
color // undefined if not set via \color
|
3805
|
+
delim: checkDelimiter(args[0], context).text
|
3821
3806
|
};
|
3822
3807
|
}
|
3823
3808
|
});
|
@@ -3846,8 +3831,7 @@ var temml = (function () {
|
|
3846
3831
|
mode: parser.mode,
|
3847
3832
|
body,
|
3848
3833
|
left: delim.text,
|
3849
|
-
right: right.delim
|
3850
|
-
rightColor: right.color
|
3834
|
+
right: right.delim
|
3851
3835
|
};
|
3852
3836
|
},
|
3853
3837
|
mathmlBuilder: (group, style) => {
|
@@ -3870,7 +3854,6 @@ var temml = (function () {
|
|
3870
3854
|
if (group.right === "\u2216" || group.right.indexOf("arrow") > -1) {
|
3871
3855
|
rightNode.setAttribute("stretchy", "true");
|
3872
3856
|
}
|
3873
|
-
if (group.rightColor) { rightNode.style.color = group.rightColor; }
|
3874
3857
|
inner.push(rightNode);
|
3875
3858
|
|
3876
3859
|
return makeRow(inner);
|
@@ -11262,7 +11245,7 @@ var temml = (function () {
|
|
11262
11245
|
* https://mit-license.org/
|
11263
11246
|
*/
|
11264
11247
|
|
11265
|
-
const version = "0.10.
|
11248
|
+
const version = "0.10.21";
|
11266
11249
|
|
11267
11250
|
function postProcess(block) {
|
11268
11251
|
const labelMap = {};
|