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

fraction bar too high in tonicdev integration #332

Closed
kevinbarabash opened this issue Aug 22, 2015 · 10 comments
Closed

fraction bar too high in tonicdev integration #332

kevinbarabash opened this issue Aug 22, 2015 · 10 comments

Comments

@kevinbarabash
Copy link
Member

https://tonicdev.com/nicole/katex
screen shot 2015-08-21 at 6 33 42 pm
My guess is that one of the styles from outside of the katex container is bleeding in.

@xymostech
Copy link
Contributor

Very strange. I can't find any styles that are being changed in the frame, but I remember seeing something like this before on android. Probably needs more investigation.

@tolmasky
Copy link

This seems unrelated to Tonic, it reproduces in a normal plain html file for me:

<html>
    <head>
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min.css">
        <script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min.js"></script>
    </head>
    <body>
        <script>
            document.body.innerHTML = katex.renderToString("x^{2} + \\frac{4}{3}x + 4", { displayMode: true });
        </script>
    </body>
 </html>

I can open a new bug "fractions are broken" if you prefer.

@sophiebits
Copy link
Contributor

Missing DOCTYPE?

@tolmasky
Copy link

Is HTML5 a requirement? If it is I'm happy to consider it fixed as missing doctype.

@sophiebits
Copy link
Contributor

Not HTML5 necessarily, but we probably don't work great in quirks mode. Any valid doctype should work (though <!DOCTYPE html> is of course the shortest). Does that fix it?

@tolmasky
Copy link

Yup, pushing a fix to tonic now. Thanks!

@sophiebits
Copy link
Contributor

Sweet. We should add a warning for this though. (jQuery doesn't support quirks mode, for instance.)

@xymostech
Copy link
Contributor

We do have a warning for it! https://github.com/Khan/KaTeX/blob/master/katex.js#L33

@tolmasky
Copy link

Yeah the problem here is that that warning doesn't happen on the client if its rendered on the server (which is what was happening here). It'll actually be kind of a common case if you do lots of server rendering of stuff as opposed to relying on it coming in on the client.

@sophiebits
Copy link
Contributor

Ahh, gotcha.

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

No branches or pull requests

4 participants