From 2979fa131e4fbf8c406a0ff4f3ea930916969959 Mon Sep 17 00:00:00 2001 From: Zicklag Date: Thu, 7 Jan 2021 12:19:01 -0600 Subject: [PATCH] Forward Plugin Parameters to mathjax-node-page Fixes #118. --- src/builtin_plugins/mathjax/index.js | 29 ++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/builtin_plugins/mathjax/index.js b/src/builtin_plugins/mathjax/index.js index b331336..6d2465b 100644 --- a/src/builtin_plugins/mathjax/index.js +++ b/src/builtin_plugins/mathjax/index.js @@ -4,18 +4,23 @@ const mjpage = require('mathjax-node-page') exports.constructor = async function (params) { return { - htmlModifiers: [ asyncMathjax ] + htmlModifiers: [asyncMathjax(params)] } } -var asyncMathjax = async function (html) { - return new Promise(resolve => { - mjpage.mjpage(html, { - format: ['TeX'] - }, { - mml: true, - css: true, - html: true - }, response => resolve(response)) - }) -} +var asyncMathjax = + (params) => { + console.log(params); + return async (html) => { + return new Promise(resolve => { + mjpage.mjpage(html, { + format: ['TeX'], + ...params + }, { + mml: true, + css: true, + html: true, + }, response => resolve(response)) + }) + } + }