Skip to content
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

MathJax does not render in draft #70

Closed
adrusi opened this issue Jan 22, 2019 · 7 comments
Closed

MathJax does not render in draft #70

adrusi opened this issue Jan 22, 2019 · 7 comments

Comments

@adrusi
Copy link

adrusi commented Jan 22, 2019

In 0.7.1, MathJax does not render equations when viewing a draft, but it does when viewing a published post.

Including the mathjax template in templates/post.tmpl fixes this.

@thebaer
Copy link
Member

thebaer commented Jan 23, 2019

Thanks. This was left out on purpose, since the MathJax setting can be enabled / disabled on individual blogs, and drafts aren't tied to any single blog.

For example, I could have multiple blogs under one account, one blog with the setting enabled and another with it disabled. Since the software doesn't know which blog the post will end up being published to, it's kind of hard to know whether or not MathJax should be rendered in the draft.

There may be some intelligent ways we can make it work in drafts, e.g. (pseudocode):

if single-user-blog and mathjax-enabled
  render-mathjax()

all-blogs := get-all-blogs()
if mathjax-enabled in all-blogs
  render-mathjax()

We could also make MathJax a per-instance setting, instead of per-blog, which would completely simplify this. That would also fit in with the eventual goal to move MathJax out of the core platform and into a plugin. But I'm open to any suggestions!

@thebaer
Copy link
Member

thebaer commented Jan 30, 2019

Another solution might be to just support a new file extension on drafts that cause MathJax to render. So we already have .txt to get plain text, .md to render Markdown -- maybe add .mj to render MathJax?

@mrvdb
Copy link
Collaborator

mrvdb commented Jan 30, 2019

what is the downside of leaving it always on, or loading on-demand?

@thebaer
Copy link
Member

thebaer commented Feb 1, 2019

Certain reserved characters could potentially interfere with normal Markdown rendering, if I'm not mistaken.

@marek-lach
Copy link

Potentially related: #90

@thebaer
Copy link
Member

thebaer commented Jun 2, 2019

Potentially related: #90

I think that's a separate issue, but it could be related.

Either way, I'm going to close this issue since it was a deliberate design decision and a fix requires more discussion. If anyone would like to help reach a conclusion on that, we should continue this over on the forum.

@thebaer thebaer closed this as completed Jun 2, 2019
@Crocmagnon
Copy link

I also experienced this issue today with v0.12.0.

Since I'm on a single user instance, I'd expect my settings, including custom CSS and Mathjax to apply on my Drafts. I understand the separation of drafts and posts tied to a blog on a multi user instance but on a single user instance this doesn't make much sense IMHO.

I'm posting this here because I felt that on a single user instance it's more an issue than a feature request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

5 participants