Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Mathjax with Markdown #54

Closed
PrithiviRajG opened this issue Apr 27, 2017 · 1 comment
Closed

Using Mathjax with Markdown #54

PrithiviRajG opened this issue Apr 27, 2017 · 1 comment

Comments

@PrithiviRajG
Copy link

We want to use formula inside the markdown.. is it possible to add mathjax with this plugin which can render formulas too?

Thanks

@paullryan
Copy link
Contributor

paullryan commented May 13, 2017

@PrithiviRajG You'd want to use the new access to the marked object (see https://github.com/dimpu/angular2-markdown#marked-customization) to get the lexer. Then write a custom marked lexer rule for /\$\$(.*)?\$\$/ (see https://github.com/chjj/marked#access-to-lexer-and-parser) and pass that to the MathJax library in a custom renderer callback function.

Example of overriding the lexer http://stackoverflow.com/questions/26507341/how-to-write-custom-inlinelexer-rule-for-marked-js.

@dimpu dimpu closed this as completed Aug 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants