temml 0.10.8 → 0.10.10
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/temml.cjs +4 -112
- package/dist/temml.js +4 -112
- package/dist/temml.min.js +1 -1
- package/dist/temml.mjs +4 -112
- package/dist/temmlPostProcess.js +1 -1
- package/package.json +1 -1
- package/src/Parser.js +2 -8
- package/src/asciiFromScript.js +1 -1
- package/src/postProcess.js +1 -1
- package/src/unicodeScripts.js +0 -119
package/dist/temml.cjs
CHANGED
@@ -11235,109 +11235,6 @@ class MacroExpander {
|
|
11235
11235
|
}
|
11236
11236
|
}
|
11237
11237
|
|
11238
|
-
/*
|
11239
|
-
* This file defines the Unicode scripts and script families that we
|
11240
|
-
* support. To add new scripts or families, just add a new entry to the
|
11241
|
-
* scriptData array below. Adding scripts to the scriptData array allows
|
11242
|
-
* characters from that script to appear in \text{} environments.
|
11243
|
-
*/
|
11244
|
-
|
11245
|
-
/**
|
11246
|
-
* Each script or script family has a name and an array of blocks.
|
11247
|
-
* Each block is an array of two numbers which specify the start and
|
11248
|
-
* end points (inclusive) of a block of Unicode codepoints.
|
11249
|
-
|
11250
|
-
/**
|
11251
|
-
* Unicode block data for the families of scripts we support in \text{}.
|
11252
|
-
* Scripts only need to appear here if they do not have font metrics.
|
11253
|
-
*/
|
11254
|
-
const scriptData = [
|
11255
|
-
{
|
11256
|
-
// Latin characters beyond the Latin-1 characters we have metrics for.
|
11257
|
-
// Needed for Czech, Hungarian and Turkish text, for example.
|
11258
|
-
name: "latin",
|
11259
|
-
blocks: [
|
11260
|
-
[0x0100, 0x024f], // Latin Extended-A and Latin Extended-B
|
11261
|
-
[0x0300, 0x036f] // Combining Diacritical marks
|
11262
|
-
]
|
11263
|
-
},
|
11264
|
-
{
|
11265
|
-
// The Cyrillic script used by Russian and related languages.
|
11266
|
-
// A Cyrillic subset used to be supported as explicitly defined
|
11267
|
-
// symbols in symbols.js
|
11268
|
-
name: "cyrillic",
|
11269
|
-
blocks: [[0x0400, 0x04ff]]
|
11270
|
-
},
|
11271
|
-
{
|
11272
|
-
// Armenian
|
11273
|
-
name: "armenian",
|
11274
|
-
blocks: [[0x0530, 0x058f]]
|
11275
|
-
},
|
11276
|
-
{
|
11277
|
-
// The Brahmic scripts of South and Southeast Asia
|
11278
|
-
// Devanagari (0900–097F)
|
11279
|
-
// Bengali (0980–09FF)
|
11280
|
-
// Gurmukhi (0A00–0A7F)
|
11281
|
-
// Gujarati (0A80–0AFF)
|
11282
|
-
// Oriya (0B00–0B7F)
|
11283
|
-
// Tamil (0B80–0BFF)
|
11284
|
-
// Telugu (0C00–0C7F)
|
11285
|
-
// Kannada (0C80–0CFF)
|
11286
|
-
// Malayalam (0D00–0D7F)
|
11287
|
-
// Sinhala (0D80–0DFF)
|
11288
|
-
// Thai (0E00–0E7F)
|
11289
|
-
// Lao (0E80–0EFF)
|
11290
|
-
// Tibetan (0F00–0FFF)
|
11291
|
-
// Myanmar (1000–109F)
|
11292
|
-
name: "brahmic",
|
11293
|
-
blocks: [[0x0900, 0x109f]]
|
11294
|
-
},
|
11295
|
-
{
|
11296
|
-
name: "georgian",
|
11297
|
-
blocks: [[0x10a0, 0x10ff]]
|
11298
|
-
},
|
11299
|
-
{
|
11300
|
-
// Chinese and Japanese.
|
11301
|
-
// The "k" in cjk is for Korean, but we've separated Korean out
|
11302
|
-
name: "cjk",
|
11303
|
-
blocks: [
|
11304
|
-
[0x3000, 0x30ff], // CJK symbols and punctuation, Hiragana, Katakana
|
11305
|
-
[0x4e00, 0x9faf], // CJK ideograms
|
11306
|
-
[0xff00, 0xff60] // Fullwidth punctuation
|
11307
|
-
// TODO: add halfwidth Katakana and Romanji glyphs
|
11308
|
-
]
|
11309
|
-
},
|
11310
|
-
{
|
11311
|
-
// Korean
|
11312
|
-
name: "hangul",
|
11313
|
-
blocks: [[0xac00, 0xd7af]]
|
11314
|
-
}
|
11315
|
-
];
|
11316
|
-
|
11317
|
-
/**
|
11318
|
-
* A flattened version of all the supported blocks in a single array.
|
11319
|
-
* This is an optimization to make supportedCodepoint() fast.
|
11320
|
-
*/
|
11321
|
-
const allBlocks = [];
|
11322
|
-
scriptData.forEach((s) => s.blocks.forEach((b) => allBlocks.push(...b)));
|
11323
|
-
|
11324
|
-
/**
|
11325
|
-
* Given a codepoint, return true if it falls within one of the
|
11326
|
-
* scripts or script families defined above and false otherwise.
|
11327
|
-
*
|
11328
|
-
* Micro benchmarks shows that this is faster than
|
11329
|
-
* /[\u3000-\u30FF\u4E00-\u9FAF\uFF00-\uFF60\uAC00-\uD7AF\u0900-\u109F]/.test()
|
11330
|
-
* in Firefox, Chrome and Node.
|
11331
|
-
*/
|
11332
|
-
function supportedCodepoint(codepoint) {
|
11333
|
-
for (let i = 0; i < allBlocks.length; i += 2) {
|
11334
|
-
if (codepoint >= allBlocks[i] && codepoint <= allBlocks[i + 1]) {
|
11335
|
-
return true;
|
11336
|
-
}
|
11337
|
-
}
|
11338
|
-
return false;
|
11339
|
-
}
|
11340
|
-
|
11341
11238
|
// Helpers for Parser.js handling of Unicode (sub|super)script characters.
|
11342
11239
|
|
11343
11240
|
const unicodeSubRegEx = /^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/;
|
@@ -11461,7 +11358,7 @@ const asciiFromScript = Object.freeze({
|
|
11461
11358
|
"\ud835\udca5": "J",
|
11462
11359
|
"\ud835\udca6": "K",
|
11463
11360
|
"\u2112": "L",
|
11464
|
-
"\
|
11361
|
+
"\u2133": "M",
|
11465
11362
|
"\ud835\udca9": "N",
|
11466
11363
|
"\ud835\udcaa": "O",
|
11467
11364
|
"\ud835\udcab": "P",
|
@@ -12740,13 +12637,8 @@ class Parser {
|
|
12740
12637
|
symbol = s;
|
12741
12638
|
} else if (text.charCodeAt(0) >= 0x80) {
|
12742
12639
|
// no symbol for e.g. ^
|
12743
|
-
if (this.settings.strict) {
|
12744
|
-
|
12745
|
-
throw new ParseError(`Unrecognized Unicode character "${text[0]}"` +
|
12746
|
-
` (${text.charCodeAt(0)})`, nucleus);
|
12747
|
-
} else if (this.mode === "math") {
|
12748
|
-
throw new ParseError(`Unicode text character "${text[0]}" used in math mode`, nucleus)
|
12749
|
-
}
|
12640
|
+
if (this.settings.strict && this.mode === "math") {
|
12641
|
+
throw new ParseError(`Unicode text character "${text[0]}" used in math mode`, nucleus)
|
12750
12642
|
}
|
12751
12643
|
// All nonmathematical Unicode characters are rendered as if they
|
12752
12644
|
// are in text mode (wrapped in \text) because that's what it
|
@@ -12977,7 +12869,7 @@ class Style {
|
|
12977
12869
|
* https://mit-license.org/
|
12978
12870
|
*/
|
12979
12871
|
|
12980
|
-
const version = "0.10.
|
12872
|
+
const version = "0.10.10";
|
12981
12873
|
|
12982
12874
|
function postProcess(block) {
|
12983
12875
|
const labelMap = {};
|
package/dist/temml.js
CHANGED
@@ -9336,109 +9336,6 @@ var temml = (function () {
|
|
9336
9336
|
}
|
9337
9337
|
}
|
9338
9338
|
|
9339
|
-
/*
|
9340
|
-
* This file defines the Unicode scripts and script families that we
|
9341
|
-
* support. To add new scripts or families, just add a new entry to the
|
9342
|
-
* scriptData array below. Adding scripts to the scriptData array allows
|
9343
|
-
* characters from that script to appear in \text{} environments.
|
9344
|
-
*/
|
9345
|
-
|
9346
|
-
/**
|
9347
|
-
* Each script or script family has a name and an array of blocks.
|
9348
|
-
* Each block is an array of two numbers which specify the start and
|
9349
|
-
* end points (inclusive) of a block of Unicode codepoints.
|
9350
|
-
|
9351
|
-
/**
|
9352
|
-
* Unicode block data for the families of scripts we support in \text{}.
|
9353
|
-
* Scripts only need to appear here if they do not have font metrics.
|
9354
|
-
*/
|
9355
|
-
const scriptData = [
|
9356
|
-
{
|
9357
|
-
// Latin characters beyond the Latin-1 characters we have metrics for.
|
9358
|
-
// Needed for Czech, Hungarian and Turkish text, for example.
|
9359
|
-
name: "latin",
|
9360
|
-
blocks: [
|
9361
|
-
[0x0100, 0x024f], // Latin Extended-A and Latin Extended-B
|
9362
|
-
[0x0300, 0x036f] // Combining Diacritical marks
|
9363
|
-
]
|
9364
|
-
},
|
9365
|
-
{
|
9366
|
-
// The Cyrillic script used by Russian and related languages.
|
9367
|
-
// A Cyrillic subset used to be supported as explicitly defined
|
9368
|
-
// symbols in symbols.js
|
9369
|
-
name: "cyrillic",
|
9370
|
-
blocks: [[0x0400, 0x04ff]]
|
9371
|
-
},
|
9372
|
-
{
|
9373
|
-
// Armenian
|
9374
|
-
name: "armenian",
|
9375
|
-
blocks: [[0x0530, 0x058f]]
|
9376
|
-
},
|
9377
|
-
{
|
9378
|
-
// The Brahmic scripts of South and Southeast Asia
|
9379
|
-
// Devanagari (0900–097F)
|
9380
|
-
// Bengali (0980–09FF)
|
9381
|
-
// Gurmukhi (0A00–0A7F)
|
9382
|
-
// Gujarati (0A80–0AFF)
|
9383
|
-
// Oriya (0B00–0B7F)
|
9384
|
-
// Tamil (0B80–0BFF)
|
9385
|
-
// Telugu (0C00–0C7F)
|
9386
|
-
// Kannada (0C80–0CFF)
|
9387
|
-
// Malayalam (0D00–0D7F)
|
9388
|
-
// Sinhala (0D80–0DFF)
|
9389
|
-
// Thai (0E00–0E7F)
|
9390
|
-
// Lao (0E80–0EFF)
|
9391
|
-
// Tibetan (0F00–0FFF)
|
9392
|
-
// Myanmar (1000–109F)
|
9393
|
-
name: "brahmic",
|
9394
|
-
blocks: [[0x0900, 0x109f]]
|
9395
|
-
},
|
9396
|
-
{
|
9397
|
-
name: "georgian",
|
9398
|
-
blocks: [[0x10a0, 0x10ff]]
|
9399
|
-
},
|
9400
|
-
{
|
9401
|
-
// Chinese and Japanese.
|
9402
|
-
// The "k" in cjk is for Korean, but we've separated Korean out
|
9403
|
-
name: "cjk",
|
9404
|
-
blocks: [
|
9405
|
-
[0x3000, 0x30ff], // CJK symbols and punctuation, Hiragana, Katakana
|
9406
|
-
[0x4e00, 0x9faf], // CJK ideograms
|
9407
|
-
[0xff00, 0xff60] // Fullwidth punctuation
|
9408
|
-
// TODO: add halfwidth Katakana and Romanji glyphs
|
9409
|
-
]
|
9410
|
-
},
|
9411
|
-
{
|
9412
|
-
// Korean
|
9413
|
-
name: "hangul",
|
9414
|
-
blocks: [[0xac00, 0xd7af]]
|
9415
|
-
}
|
9416
|
-
];
|
9417
|
-
|
9418
|
-
/**
|
9419
|
-
* A flattened version of all the supported blocks in a single array.
|
9420
|
-
* This is an optimization to make supportedCodepoint() fast.
|
9421
|
-
*/
|
9422
|
-
const allBlocks = [];
|
9423
|
-
scriptData.forEach((s) => s.blocks.forEach((b) => allBlocks.push(...b)));
|
9424
|
-
|
9425
|
-
/**
|
9426
|
-
* Given a codepoint, return true if it falls within one of the
|
9427
|
-
* scripts or script families defined above and false otherwise.
|
9428
|
-
*
|
9429
|
-
* Micro benchmarks shows that this is faster than
|
9430
|
-
* /[\u3000-\u30FF\u4E00-\u9FAF\uFF00-\uFF60\uAC00-\uD7AF\u0900-\u109F]/.test()
|
9431
|
-
* in Firefox, Chrome and Node.
|
9432
|
-
*/
|
9433
|
-
function supportedCodepoint(codepoint) {
|
9434
|
-
for (let i = 0; i < allBlocks.length; i += 2) {
|
9435
|
-
if (codepoint >= allBlocks[i] && codepoint <= allBlocks[i + 1]) {
|
9436
|
-
return true;
|
9437
|
-
}
|
9438
|
-
}
|
9439
|
-
return false;
|
9440
|
-
}
|
9441
|
-
|
9442
9339
|
// Helpers for Parser.js handling of Unicode (sub|super)script characters.
|
9443
9340
|
|
9444
9341
|
const unicodeSubRegEx = /^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/;
|
@@ -9562,7 +9459,7 @@ var temml = (function () {
|
|
9562
9459
|
"\ud835\udca5": "J",
|
9563
9460
|
"\ud835\udca6": "K",
|
9564
9461
|
"\u2112": "L",
|
9565
|
-
"\
|
9462
|
+
"\u2133": "M",
|
9566
9463
|
"\ud835\udca9": "N",
|
9567
9464
|
"\ud835\udcaa": "O",
|
9568
9465
|
"\ud835\udcab": "P",
|
@@ -10841,13 +10738,8 @@ var temml = (function () {
|
|
10841
10738
|
symbol = s;
|
10842
10739
|
} else if (text.charCodeAt(0) >= 0x80) {
|
10843
10740
|
// no symbol for e.g. ^
|
10844
|
-
if (this.settings.strict) {
|
10845
|
-
|
10846
|
-
throw new ParseError(`Unrecognized Unicode character "${text[0]}"` +
|
10847
|
-
` (${text.charCodeAt(0)})`, nucleus);
|
10848
|
-
} else if (this.mode === "math") {
|
10849
|
-
throw new ParseError(`Unicode text character "${text[0]}" used in math mode`, nucleus)
|
10850
|
-
}
|
10741
|
+
if (this.settings.strict && this.mode === "math") {
|
10742
|
+
throw new ParseError(`Unicode text character "${text[0]}" used in math mode`, nucleus)
|
10851
10743
|
}
|
10852
10744
|
// All nonmathematical Unicode characters are rendered as if they
|
10853
10745
|
// are in text mode (wrapped in \text) because that's what it
|
@@ -11078,7 +10970,7 @@ var temml = (function () {
|
|
11078
10970
|
* https://mit-license.org/
|
11079
10971
|
*/
|
11080
10972
|
|
11081
|
-
const version = "0.10.
|
10973
|
+
const version = "0.10.10";
|
11082
10974
|
|
11083
10975
|
function postProcess(block) {
|
11084
10976
|
const labelMap = {};
|