temml 0.13.3 → 0.13.4
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-Asana.css +17 -3
- package/dist/Temml-Latin-Modern.css +17 -3
- package/dist/Temml-Libertinus.css +17 -4
- package/dist/Temml-Local.css +19 -5
- package/dist/Temml-NotoSans.css +19 -5
- package/dist/Temml-STIX2.css +19 -5
- package/dist/temml.cjs +20 -9
- package/dist/temml.js +20 -9
- package/dist/temml.min.js +1 -1
- package/dist/temml.mjs +20 -9
- package/dist/temmlPostProcess.js +1 -1
- package/package.json +1 -1
- package/src/postProcess.js +1 -1
- package/src/stretchy.js +18 -7
- package/src/symbols.js +1 -1
package/dist/temml.mjs
CHANGED
|
@@ -785,7 +785,7 @@ const estimatedWidth = node => {
|
|
|
785
785
|
};
|
|
786
786
|
|
|
787
787
|
const stretchyCodePoint = {
|
|
788
|
-
widehat: "
|
|
788
|
+
widehat: "\u02c6", // Shorter than \u005e, which is appropriate for an accent.
|
|
789
789
|
widecheck: "ˇ",
|
|
790
790
|
widetilde: "~",
|
|
791
791
|
wideparen: "⏜", // \u23dc
|
|
@@ -848,19 +848,30 @@ const mathMLnode = function(label) {
|
|
|
848
848
|
return node
|
|
849
849
|
};
|
|
850
850
|
|
|
851
|
-
const
|
|
851
|
+
const wideHats = ["\\widehat", "\\widecheck"];
|
|
852
852
|
|
|
853
|
-
// TODO: Remove when Chromium stretches \widetilde & \widehat
|
|
853
|
+
// TODO: Remove if/when Chromium stretches \widetilde & \widehat
|
|
854
854
|
const accentNode = (group) => {
|
|
855
855
|
const mo = mathMLnode(group.label);
|
|
856
|
-
if (
|
|
856
|
+
if (group.label.indexOf("tilde") > -1) {
|
|
857
857
|
const width = estimatedWidth(group.base);
|
|
858
858
|
if (1 < width && width < 1.6) {
|
|
859
|
-
mo.classes.push("tml-
|
|
859
|
+
mo.classes.push("tml-tilde-2");
|
|
860
|
+
} else if (1.6 <= width && width < 2.5) {
|
|
861
|
+
mo.classes.push("tml-tilde-3");
|
|
862
|
+
} else if (2.5 <= width) {
|
|
863
|
+
mo.classes.push("tml-tilde-4");
|
|
864
|
+
}
|
|
865
|
+
} else if (wideHats.includes(group.label)) {
|
|
866
|
+
const width = estimatedWidth(group.base);
|
|
867
|
+
if (0 < width && width <= 1) {
|
|
868
|
+
mo.classes.push("tml-hat-1");
|
|
869
|
+
} else if (1 < width && width < 1.6) {
|
|
870
|
+
mo.classes.push("tml-hat-2");
|
|
860
871
|
} else if (1.6 <= width && width < 2.5) {
|
|
861
|
-
mo.classes.push("tml-
|
|
872
|
+
mo.classes.push("tml-hat-3");
|
|
862
873
|
} else if (2.5 <= width) {
|
|
863
|
-
mo.classes.push("tml-
|
|
874
|
+
mo.classes.push("tml-hat-4");
|
|
864
875
|
}
|
|
865
876
|
}
|
|
866
877
|
return mo
|
|
@@ -1769,7 +1780,7 @@ defineSymbol(math, accent, "\u007e", "\\tilde");
|
|
|
1769
1780
|
defineSymbol(math, accent, "\u203e", "\\bar");
|
|
1770
1781
|
defineSymbol(math, accent, "\u02d8", "\\breve");
|
|
1771
1782
|
defineSymbol(math, accent, "\u02c7", "\\check");
|
|
1772
|
-
defineSymbol(math, accent, "\
|
|
1783
|
+
defineSymbol(math, accent, "\u02c6", "\\hat");
|
|
1773
1784
|
defineSymbol(math, accent, "\u2192", "\\vec");
|
|
1774
1785
|
defineSymbol(math, accent, "\u02d9", "\\dot");
|
|
1775
1786
|
defineSymbol(math, accent, "\u02da", "\\mathring");
|
|
@@ -14195,7 +14206,7 @@ class Style {
|
|
|
14195
14206
|
* https://mit-license.org/
|
|
14196
14207
|
*/
|
|
14197
14208
|
|
|
14198
|
-
const version = "0.13.
|
|
14209
|
+
const version = "0.13.4";
|
|
14199
14210
|
|
|
14200
14211
|
function postProcess(block) {
|
|
14201
14212
|
const labelMap = {};
|
package/dist/temmlPostProcess.js
CHANGED
package/package.json
CHANGED
package/src/postProcess.js
CHANGED
package/src/stretchy.js
CHANGED
|
@@ -35,7 +35,7 @@ const estimatedWidth = node => {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
const stretchyCodePoint = {
|
|
38
|
-
widehat: "
|
|
38
|
+
widehat: "\u02c6", // Shorter than \u005e, which is appropriate for an accent.
|
|
39
39
|
widecheck: "ˇ",
|
|
40
40
|
widetilde: "~",
|
|
41
41
|
wideparen: "⏜", // \u23dc
|
|
@@ -98,19 +98,30 @@ export const mathMLnode = function(label) {
|
|
|
98
98
|
return node
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
const
|
|
101
|
+
const wideHats = ["\\widehat", "\\widecheck"];
|
|
102
102
|
|
|
103
|
-
// TODO: Remove when Chromium stretches \widetilde & \widehat
|
|
103
|
+
// TODO: Remove if/when Chromium stretches \widetilde & \widehat
|
|
104
104
|
export const accentNode = (group) => {
|
|
105
105
|
const mo = mathMLnode(group.label)
|
|
106
|
-
if (
|
|
106
|
+
if (group.label.indexOf("tilde") > -1) {
|
|
107
107
|
const width = estimatedWidth(group.base)
|
|
108
108
|
if (1 < width && width < 1.6) {
|
|
109
|
-
mo.classes.push("tml-
|
|
109
|
+
mo.classes.push("tml-tilde-2")
|
|
110
|
+
} else if (1.6 <= width && width < 2.5) {
|
|
111
|
+
mo.classes.push("tml-tilde-3")
|
|
112
|
+
} else if (2.5 <= width) {
|
|
113
|
+
mo.classes.push("tml-tilde-4")
|
|
114
|
+
}
|
|
115
|
+
} else if (wideHats.includes(group.label)) {
|
|
116
|
+
const width = estimatedWidth(group.base)
|
|
117
|
+
if (0 < width && width <= 1) {
|
|
118
|
+
mo.classes.push("tml-hat-1")
|
|
119
|
+
} else if (1 < width && width < 1.6) {
|
|
120
|
+
mo.classes.push("tml-hat-2")
|
|
110
121
|
} else if (1.6 <= width && width < 2.5) {
|
|
111
|
-
mo.classes.push("tml-
|
|
122
|
+
mo.classes.push("tml-hat-3")
|
|
112
123
|
} else if (2.5 <= width) {
|
|
113
|
-
mo.classes.push("tml-
|
|
124
|
+
mo.classes.push("tml-hat-4")
|
|
114
125
|
}
|
|
115
126
|
}
|
|
116
127
|
return mo
|
package/src/symbols.js
CHANGED
|
@@ -902,7 +902,7 @@ defineSymbol(math, accent, "\u007e", "\\tilde");
|
|
|
902
902
|
defineSymbol(math, accent, "\u203e", "\\bar");
|
|
903
903
|
defineSymbol(math, accent, "\u02d8", "\\breve");
|
|
904
904
|
defineSymbol(math, accent, "\u02c7", "\\check");
|
|
905
|
-
defineSymbol(math, accent, "\
|
|
905
|
+
defineSymbol(math, accent, "\u02c6", "\\hat");
|
|
906
906
|
defineSymbol(math, accent, "\u2192", "\\vec");
|
|
907
907
|
defineSymbol(math, accent, "\u02d9", "\\dot");
|
|
908
908
|
defineSymbol(math, accent, "\u02da", "\\mathring");
|