cheeaun / phanpy

A minimalistic opinionated Mastodon web client
https://phanpy.social
MIT License
1.11k stars 112 forks source link

Feature Request: Enable MathJax for posts from specific instances #320

Open spectraldani opened 1 year ago

spectraldani commented 1 year ago

I was wondering, could we have an off-by-default option to allow MathJax rendering in posts from specific instances? For example, Mathsodon.xyz renders maths in their posts such that it looks like this in their instance: image Meanwhile, in Phanpy, it gets rendered as: image

I feel like there could be a chance of false-negatives if this was activated for all posts, so I thought that there could be an list of allowed instances that could be user editable. It's okay if this feature gets decided as too complex, I understand it would only matter for a small number of users 😅

filipesmedeiros commented 1 year ago

@cheeaun I would go the route of dynamic importing the necessary code to render this. I don't know how Preact handles dynamic imports, but should be easy?

mrdk commented 1 year ago

@spectraldani Thanks, I wanted already to create a similar issue.

Having MathJax support in a desktop client would also make it possible for users of all Mastodon instances to view and write mathematics correctly, so it might matter for a larger number of users. (There is already the Fedilab Android client that supports MathJax, but a Desktop client would certainly reach more users.)