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

Dropdown menu displays both KaTeX-MathML and KaTeX-HTML #572

Closed
SamanthaYu opened this issue Nov 27, 2016 · 3 comments

Comments

@SamanthaYu
Copy link

commented Nov 27, 2016

The dropdown menu displays both the KaTeX-MathML (including the annotation) and KaTeX-HTML elements so the math symbols appear to be rendered on both sides of the annotation.

It seems to be an HTML issue, because I tried to hide the MathML with JavaScript (by setting the visibility to hidden, and display to none), and it does not affect the dropdown menu. In other words, hidden elements still appear in the dropdown menu.

In the end, I fixed it by getting rid of the MathML elements in the dropdown menu:
$('option .katex-mathml').remove();

Now, the dropdown menu looks like this:

It's probably not the best solution but more of a temporary fix until this issue gets resolved someday.

@gagern

This comment has been minimized.

Copy link
Collaborator

commented Nov 29, 2016

I feel like I'm missing some context here. What dropdown menu would that be?

@xymostech

This comment has been minimized.

Copy link
Contributor

commented Nov 29, 2016

@SamanthaYu It would be nice if you added some code, but I think you're trying to put KaTeX-rendered math inside of your <option> tags in your dropdown?

<option> elements can only contain text, not markup tags like what KaTeX produces, which is why you're seeing all of the text that is contained in the markup that KaTeX produces. Since the markup contains MathML, that text is displayed as well.

So, KaTeX doesn't support rendering math in dropdowns. You should just copy the individual characters that you want (like ±, , θ, π) and put those directly in your <option> elements.

@xymostech xymostech closed this Nov 29, 2016
@SamanthaYu

This comment has been minimized.

Copy link
Author

commented Dec 1, 2016

Sorry for the missing context, but yes, I was trying to put KaTeX-rendered math instead of the <option> tags.

Thank you, @xymostech, for clearing that up! That makes a lot of sense.

@alexjbest alexjbest referenced this issue Dec 8, 2018
15 of 15 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.