Skip to content

Commit 20b5622

Browse files
committed
[main] extensions options: support names containing "s"
Resolves #401
1 parent 504f473 commit 20b5622

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

lib/main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ function ConfigureMathJax() {
532532
//
533533
// Parse added extensions list and add to standard ones
534534
//
535-
var extensionList = extensions.split(/s*,\s*/);
535+
var extensionList = extensions.split(/\s*,\s*/);
536536
for (var i = 0; i < extensionList.length; i++) {
537537
var matches = extensionList[i].match(/^(.*?)(\.js)?$/);
538538
window.MathJax.extensions.push(matches[1] + '.js');

test/base-config-extensions.js

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
var tape = require('tape');
2+
var mjAPI = require('../lib/main.js');
3+
4+
tape('Options "extension": multiple extensions', function(t) {
5+
t.plan(1);
6+
mjAPI.config({
7+
extensions: 'TeX/autoload-all.js, TeX/color.js'
8+
});
9+
mjAPI.typeset(
10+
{
11+
math: 'E = mc^2',
12+
format: 'TeX',
13+
mml: true
14+
},
15+
function(data) {
16+
t.notOk(
17+
data.errors,
18+
'Config block with multiple extensions throws no error'
19+
);
20+
}
21+
);
22+
});

0 commit comments

Comments
 (0)