tao-test/app/taoQtiItem/views/js/mathRenderer/mathRenderer.js

17 lines
438 B
JavaScript
Raw Normal View History

2022-08-29 20:14:13 +02:00
define(['mathJax'], function(MathJax){
function render($container){
$container.find('math').each(function(){
var $math = $(this);
$math.wrap($('<span>', {'class':'math-renderer'}));
var $wrap = $math.parent('.math-renderer');
MathJax.Hub.Queue(["Typeset", MathJax.Hub, $wrap[0]]);
});
}
return {
render : render
};
});