josdejong/mathjs

handler option for #toHTML not working

Open

#2,425 opened on 2022年2月17日

GitHub で見る
 (1 comment) (0 reactions) (0 assignees)JavaScript (1,298 forks)batch import
bughelp wanted

Repository metrics

Stars
 (13,832 stars)
PR merge metrics
 (30d に merged 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?

コントリビューターガイド