diff --git a/src/render/index.js b/src/render/index.js
index 7ab1b20..1b2fabb 100644
--- a/src/render/index.js
+++ b/src/render/index.js
@@ -18,6 +18,7 @@ const RESPONSE_TYPES = {
mathml: 'application/mathml+xml',
png: 'image/png',
svg: 'image/svg+xml',
+ json: 'application/json',
};
/**
@@ -31,9 +32,6 @@ const defaultConfiguration = {
require: require,
load: ['adaptors/liteDOM', 'input/mml', 'input/tex-full', 'output/svg']
},
- options: {
- enableAssistiveMml: false
- }
}
const MJAX_SETTINGS = process.env.MJAX_SETTINGS ? JSON.parse(process.env.MJAX_SETTINGS) : defaultConfiguration;
MathJax = MJAX_SETTINGS;
@@ -82,12 +80,12 @@ const typeset = async (data) => {
if (data.svg) {
return MathJax.tex2svgPromise(data.math);
}
- throw new Error(`Supported output formats for ${data.format} input are: MathML, SVG`);
+ throw new Error(`Supported output formats for ${data.format} input are: MathML, SVG, AssistiveSVG`);
case 'MathML':
if (data.svg) {
return MathJax.mathml2svgPromise(data.math);
}
- throw new Error(`Supported output formats for ${data.format} input are: SVG`);
+ throw new Error(`Supported output formats for ${data.format} input are: SVG, AssistiveSVG`);
default:
throw new Error(`Unsupported input format: ${data.format}`);
}
@@ -109,6 +107,21 @@ const typeset = async (data) => {
}
};
+/**
+ * Render math.
+ *
+ * @param {Typesetted} Result of a typesetted input.
+ * @returns {svg: string, assistiveML: string}
+ */
+const getSvgAndAssistiveML = (typesetted) => {
+ const svgAndAssistiveML = /(');
+ expect(data).to.be.a('string').that.match(/