joeyespo / grip

Preview GitHub README.md files locally before committing them.
MIT License
6.42k stars 422 forks source link

Feature request:math #362

Open ilemhadri opened 2 years ago

ilemhadri commented 2 years ago

Github supports the insertion of latex into markdown, and it would be a very useful feature for grip.

Github has a hack for rendering LaTeX that essentially involves using

https://render.githubusercontent.com/render/math?math=<insert latex here>

Something like that would be great in grip.

garrison commented 2 years ago

There is no longer any need for the hack, as GitHub now supports LaTeX equations in Markdown natively using MathJax. It would be great, however, if grip could display such equations correctly in its preview.

MorganBergen commented 1 year ago

My latex injection won't render through grip, but it will render on actual github

actual github

Screenshot 2022-11-29 at 7 45 21 AM

local host

Screenshot 2022-11-29 at 7 45 25 AM
Antonio-R1 commented 1 year ago

On GitHub a custom math-renderer HTML element is used for rendering the mathematical expressions. I added support for the math-renderer HTML element in my pull request in a new commit. It only works when the --user-content option is also used as explained in the pull request, since we do not get the math-renderer HTML elements in raw mode. The --export option does not use the math-renderer HTML elements in the implementation from the pull request.

xrchz commented 2 months ago

This is already requested in the issue #208