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

Parse markdown correctly when mathjax is disabled #3836

Merged
merged 1 commit into from Jul 31, 2013

Conversation

jhamrick
Copy link
Contributor

This should resolve #3835

@Carreau
Copy link
Member

Carreau commented Jul 30, 2013

Hum, I suppose you discovered that in the plane :-) for the flight back you can install mathjax locally before taking off :-) will test with no internet connexion to see if it also works.

@jhamrick
Copy link
Contributor Author

Yeah, I just installed mathjax locally -- I will investigate further when I lose internet :-)

@Carreau
Copy link
Member

Carreau commented Jul 30, 2013

I htink this is more a question of remove_math that return a string

 if (!window.MathJax) {
            return text;
}

Instead of a tuple of 2 elements [text,math] (with math=null) when Mathjax is not loaded :-)

@jhamrick
Copy link
Contributor Author

Ahh, yeah, that makes more sense. I will update the pull request in a few hours when I can push from my laptop again.

@Carreau
Copy link
Member

Carreau commented Jul 30, 2013

Good second flight. And work also on your PhD. :-)

You might want to merge #3838 and set custom mathjax_url to simulate a fail to load mathjax now that you have local version :-)

if (window.mathjax_url != "") {
var text_math = IPython.mathjaxutils.remove_math(text);
var text = text_math[0];
var math = text_math[1];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no var on text or math here, they are both declared above.

(I know this isn't a change you introduced, but might as well fix it while we are here).

@jhamrick
Copy link
Contributor Author

Alright, I updated the PR. I checked to see what happens when even with mathjax installed locally. Without the PR:

  1. With internet -- cells render correcty
  2. With local mathjax, without internet -- cells render correctly
  3. Without local mathjax, without internet -- cells render incorrectly
  4. With --no-mathjax -- cells render incorrectly

This should fix both cases 3 and 4. I went ahead and also fixed the code (which is basically identical) for heading cells, which suffer from the same bug.

@jhamrick
Copy link
Contributor Author

Also @Carreau I'm not totally sure what you mean by setting the custom mathjax_url to simulate a failure to load. But, I see #3838 was closed -- so is that suggestion still relevant?

@minrk
Copy link
Member

minrk commented Jul 30, 2013

tested locally while off-network, and seems to work fine. 👍 to merge.

minrk added a commit that referenced this pull request Jul 31, 2013
Parse markdown correctly when mathjax is disabled

Closes #3835
@minrk minrk merged commit 07586e3 into ipython:master Jul 31, 2013
@Carreau
Copy link
Member

Carreau commented Jul 31, 2013

Le mardi 30 juillet 2013, Jessica B. Hamrick a écrit :

Also @Carreau https://github.com/Carreau I'm not totally sure what you
mean by setting the custom mathjax_url to simulate a failure to load.
But, I see #3838 #3838 was
closed -- so is that suggestion still relevant?

My suggestion was just to use the configurability of mathjax URL to
simulate a failure to load (set mathjax URL to Http://foo.bar which does
not exist), as when you have local mathjax installed even without Internet
it picks up the local version, except if you explicitly tell it the URL.
Any way.

Thanks for the fix, have a lot of beer, hope you're not too jet lagged. I
personally am still half way between CA and Europe.

@jhamrick
Copy link
Contributor Author

Ahhh, I see, that makes sense. In general I tend to prefer to differentiate between the cases when there's a failure vs a feature is disabled, but it doesn't matter now anyway.

Thanks, and I will have lots of delicious german beer! :)

mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
Parse markdown correctly when mathjax is disabled

Closes ipython#3835
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Markdown cells do not render correctly when mathjax is disabled
3 participants