Open lsbardel opened 9 years ago
Hi,
Thanks for your article. I also made a custom directive based on your code. However, when i used "<" or ">" signs (e.g., <katex> 0 > p > 1 </katex>), the directive broke, probably because the <> signs are used for html tags. Would there be a way to work around this?
Thanks!
Looks like the only option is to fallback to MathJax by using begin{equation}
<div katex>
\begin{equation}
0 > p > \frac{1}{a}
\end{equation}
</div>
You may want to ask the question to the Katex developer for a better answer.
Great article, thanks! However I've got a problem, I render equations fetched from a DB so my controller looks like this
.controller('FormulaCrtl', ['$scope', function($scope) {
// I really got this from a service
$scope.formula = {
title: 'Lorem ipsum',
content: '<katex>d y_t = \alpha_t dt + \sigma_t d W_t</katex>'
};
}])
.filter('html', ['$sce', function ($sce) {
return function (text) {
return $sce.trustAsHtml(text);
};
}]);
When I render as <div ng-bind-html="article.content | html"></div>
the equation is not rendered by your KaTeX directive, how could I solve it? Thanks again!
Feedbacks and Comments for http://lucasbardella.com/blog/2014/11/katex-angularjs