thisiscam / math-with-slack

Rendered math (MathJax) with Slack's desktop client
MIT License
306 stars 28 forks source link

Working in conjunction with code formatting? #41

Closed motiwari closed 2 years ago

motiwari commented 2 years ago

Thanks for making this extension. Are there any plans for making this work with concurrently with code-formatting in slack?

For example, if I want to type a mathematical algorithm as pseudocode, I may need something like

$X$ = 5

perhaps this is as simple as checking inside backtick or triple-backtick blocks for latex delimiters and applying the latex style that is congruent with the code formatting?

thisiscam commented 2 years ago

You are welcomed to try the above branch and give any feedback!

motiwari commented 2 years ago

Thanks for the quick turnaround!

It looks like it works in triple-backtick code blocks:

image

But not in inline code segments (tried both ` outside of $ and $ outside of `):

image

Also, for some reason I had to run the script twice (got a Missing backup error), unsure if related:

image
thisiscam commented 2 years ago

Just pushed a commit that also enables it for inline code block.

That missing backup is likely something else. It's simply a check there to ensure the plugin did not corrupt Slack. You should open an issue if this occurs again!

motiwari commented 2 years ago

It works!! Incredible!

image

thisiscam commented 2 years ago

I suspect there could be places that this might overshoot, but so far I have not found any. I will leave this open for a couple more days for feedbacks.