Adding Maths support for Chat

I have a recently upgraded discourse instance (discourse 92bb728fe5, discourse-math f9cf94d2). I have configured discourse-math to use katex, but the problem appears with mathjax too. I observe that math is rendered correctly in post previews, in posts themselves, but not in chats. Below are the screenshots:



image

2개의 좋아요

I may be wrong, but I think that Discourse Chat does not use the same “rendering method” as in topics and posts, I haven’t tested it well but I think it barely supports some features of Markdown

This was a topic of discussion before, and judging by the responses it is a supported feature.

1개의 좋아요

Moved to Contribute > Feature request as enabling each Customization > Plugin or Customization > Theme component in chat is a new feature that needs to be planned, written and tested as we don’t automatically apply all the same markdown cooking of posts.

8개의 좋아요

I pushed support for this in chat:

https://github.com/discourse/discourse-math/commit/6f59c4691239223d20e0723918375b0a3ac6ede0

This plugin would need multiple changes to avoid jumpyness, but that will have to wait.

9개의 좋아요

It seems that it only works for MathJax. Maybe we need another patch for KaTeX?

1개의 좋아요

Indeed, that should do it:

https://github.com/discourse/discourse-math/pull/88

Will merge it next week.

3개의 좋아요