From e8c78f0fa4162e51655b29bd39f04267ef65b5a3 Mon Sep 17 00:00:00 2001 From: mgt Date: Wed, 8 May 2024 00:13:56 +0800 Subject: [PATCH] feat: allow controlling math behavior --- index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 2dba6cd..b51accb 100644 --- a/index.js +++ b/index.js @@ -3,9 +3,11 @@ import formatCode from './code/format-code.js'; import formatMath from './math/format-math.js'; -export default function remarkCodeFormat() { +export default function remarkCodeFormat(options) { return function transformer(tree) { formatCode(tree); - formatMath(tree); + if (options && options.math) { + formatMath(tree); + } }; }