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
Rendering issues in MathJax when nested with markdown symbols (*, _) #177
Comments
Just getting some ideas here. There are a few hacks we could employ, but maybe we should consider moving to Blackfriday with blackfriday-latex. Although that extension hasn't been updated in the last year. |
@RJ722 if you could try wrapping the section of your post containing math in a paragraph tag, I would be interested if things then work as expected. I.e. |
@thebaer I think the issue here is that our markdown processor is breaking the math blocks. I will see if blackfriday supports skipping these, if not I think the best way would be to write a blackfriday extension that does exactly that. It shouldn't be too much work as we know what our inline and display delimiters are. |
Hi @robjloranger, thanks for the response. I currently don't have access to the blog instance, so can't help you out there. 😅 I haven't used blackfriday-latex before, but it looks like it isn't being actively developed right now. Also, since MathJax is so hugely popular, we can expect folks to be more familiar with it's syntax and ask for it's support, which is why I was wondering how complicated the patch for the current thing would look like? If it isn't too much, I would vote for continuing support with MathJax. Again, thank you for building this wonderful tool! :-) |
No problem, I confirmed that this does seem to fix the problem but introduces a new one. Markdown is then rendered as literal text. I think our best bet is to parse the post body before rendering the markdown. Whether that is with an extension of blackfriday or our own in house solution, it will not change the MathJax behavior. This would probably involve parsing the body and wrapping MathJax notation in a span with a class like |
Ahh, that cleared up my confusion, thanks!
Yeah, that makes total sense. |
You could investigate switching from blackfriday to https://github.com/gomarkdown/markdown which is a compatible fork that is still being maintained and I think actively focused on solving these Markdown rendering issues... |
I tried to post some mathJax code on my instance but seems it's not working, see my blog: https://noblogo.org/writefreely/ and it looks even more a mess on the post page: https://noblogo.org/writefreely/writefreely-supports-latex-via-mathjax I activated mathjax on the blog and used some code example from this page: https://www.mathjax.org/#samples so the results were different and far from what expected... tried several times but nothing worked. |
@filippodb is this your own instance? If so what version are you running? You may be experiencing the issue with mathjax not being included #176 if you did not install it manually, this was fixed for v0.10 afaik (see comment). I think that was a manual intervention though so later versions might still be affected. There is a PR open to address the underlying issue #181. |
sorry for the late reply, I didn't expect some questions as the instance noblogo.org is hosted by writefreely on writefreely.host so it has the latest build: 0.11.2 and mathjax is far from working. |
This woked perfect ; Here is an example with and without |
when will the bug be fixed? |
I'm sorry suddenly, About setting of "Text Rendering (Customize how plain text renders on your blog.)" |
Describe the bug
When symbols like
*
,_
are nested with the$
symbol, or are used in the same line as math, MathJax does not render them properly.Steps to reproduce (if necessary)
Steps to reproduce the behavior:
Rendering issues can be seen in the following examples:
Here is a live example . Also, I've attached a screenshot:
Application configuration
Version or last commit:
v0.10.0
The text was updated successfully, but these errors were encountered: