josdejong/mathjs

handler option for #toHTML not working

Open

#2425 aperta il 17 feb 2022

Vedi su GitHub
 (1 commento) (0 reazioni) (0 assegnatari)JavaScript (1298 fork)batch import
bughelp wanted

Metriche repository

Star
 (13.832 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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?

Guida contributor