josdejong/mathjs

handler option for #toHTML not working

Open

#2,425 创建于 2022年2月17日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)JavaScript (1,298 fork)batch import
bughelp wanted

仓库指标

Star
 (13,832 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

math.parse("sumMap(list,mapper)=sum(map(list,mapper))").toHTML({handler: (node, options) => "hello"})

'<span class="math-function">sumMap</span><span class="math-parenthesis math-round-parenthesis">(</span><span class="math-symbol math-parameter">list</span><span class="math-separator">,</span><span class="math-symbol math-parameter">mapper</span><span class="math-parenthesis math-round-parenthesis">)</span><span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span><span class="math-function">sum</span><span class="math-paranthesis math-round-parenthesis">(</span><span class="math-function">map</span><span class="math-paranthesis math-round-parenthesis">(</span><span class="math-symbol">list</span><span class="math-separator">,</span><span class="math-symbol">mapper</span><span class="math-paranthesis math-round-parenthesis">)</span><span class="math-paranthesis math-round-parenthesis">)</span>'

There is no "hello" in output. Am I doing something wrong here?

贡献者指南