-
Notifications
You must be signed in to change notification settings - Fork 0
fixed linebreaks and ampersands #1
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
Conversation
|
Huh, I'm not quite so sure how this works 🤔. But I'm not one to argue with regex magic, so go ahead! |
|
I didn't catch it also, but StackExchance, you know... xD |
|
It's deployed automatically on the mathembed.com server, in case you want to check. Also, thank you for contributing! PS: May I know where you're using mathembed? I'd love to place your work as part of an "examples" section in the README! |
|
I used it on Medium. Although looks like I can't control the embed area size there, which is quite sad |
|
Ah, that's sadly a limitation of the oembed spec. You have to provide a set height and width. I wonder if you could set it dynamically 🤔 (will have to double check if the spec has changed) |
|
If it helps, we could reduce the default height to fit most common use cases |
|
If you control the the size of an embed area, it's better to make it fit the content. |
|
About the PR, it was a very quick fix, consifer moving the code here https://github.com/codeOfRobin/MathEmbed/blob/master/app.js#L51 When it's where it is now, the processing and markup are mixed, whis is a bad architecture |
Yes, definitely 😄 . I wrote this as a quick hack over a couple of days, will definitely consider cleaning it up. As for the size considerations, check out section 2.3.4.4 on https://oembed.com . I wonder if there's a way to compute an estimated height from the embed URL? |
|
? It will solve the problem if we just let the user control the width/height values via the GET parameters |

I tried to display my equation like this (but a bit more heavy)
https://mathembed.com/latex?inputText=%5Cbegin%7Bpmatrix%7D%0Ay_0%20%26%20z_c%20%26%20x_0%0A%5Cend%7Bpmatrix%7D
and failed.
Here's the fix, please merge and publish to mathembed.com