Skip to content

Commit d36d551

Browse files
committed
Add filtering of scriptlevel, scriptsizemultiplier, and scriptminsize (as per Fred's examples).
1 parent 084385b commit d36d551

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

unpacked/extensions/Safe.js

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,14 @@
102102
// Methods called for MathML attribute processing
103103
//
104104
filter: {
105-
"class": "filterClass",
106-
id: "filterID",
107-
fontsize: "filterFontSize",
108-
mathsize: "filterFontSize",
109-
style: "filterStyles"
105+
"class": "filterClass",
106+
style: "filterStyles",
107+
id: "filterID",
108+
fontsize: "filterFontSize",
109+
mathsize: "filterFontSize",
110+
scriptminsize: "filterFontSize",
111+
scriptsizemultiplier: "filterSizeMultiplier",
112+
scriptlevel: "filterScriptLevel"
110113
},
111114

112115
//
@@ -182,6 +185,23 @@
182185
return (ALLOW.fontsize === "all" ? size: null);
183186
},
184187

188+
//
189+
// Filter scriptsizemultiplier
190+
//
191+
filterSizeMultiplier: function (size) {
192+
if (ALLOW.fontsize === "none") {size = null}
193+
else if (ALLOW.fontsize !== "all") {size = Math.min(1,size).toString()}
194+
return size;
195+
},
196+
//
197+
// Filter scriptLevel
198+
//
199+
filterScriptLevel: function (level) {
200+
if (ALLOW.fontsize === "none") {level = null}
201+
else if (ALLOW.fontsize !== "all") {level = Math.max(0,level).toString()}
202+
return level;
203+
},
204+
185205
//
186206
// Filter TeX extension names
187207
//

0 commit comments

Comments
 (0)