-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Feature request: Add ignoreClass to mml2jax configuration options #505
Comments
I'm curious what "other tools for ContentMathML" you're thinking of. Also, are you aware of the ContentMathML extension? |
Hi Peter, I have written a working content MathML equation editor in JavaScript (ported from ActionScript, actually) that creates content and presentation MathML in parallel as the user types. Previous versions of the editor included a custom MathML rendering engine optimized for incremental updates needed by the editor. I have the editor working using the browser native MathML rendering support, where it exists, and using the MathJax MathML rendering support. The equation editor is set up to attach to instances of content MathML it finds in the page, so I would like to be able to ask MathJax to stand by until I'm ready to give it presentation MathML for it to render. Alternatively, there may be other instances of presentation MathML in the page that I would like MathJax to render, and that the editor should ignore. I realize that having an equation editor call MathJax in this way asks it to do things for which it was not really designed, but it performs surprisingly well under the circumstances, and I am quite pleased with the result. Sam |
Hi Sam, Thanks for the details -- that's sounds very interesting! Any chance this will end up open source? In general, I'd be in favor of this feature -- simply because of consistency with other input-jax's. [I don't quite understand why you'd let MathJax render the entire page, tough. I'd rather make individual typesetting calls for those elements that have been added to the page. But that's not my call, of course.] |
Hi Peter, Unfortunately I don't think this will become open source anytime soon, but it does have some likelihood of showing up in Pearson assessment offerings at some point. While testing the patch I noticed that if MathJax gets in too early, Opera hasn't yet created the className attribute for the math elements, so I added a call to getAttribute( "class" ) as a fallback in the line that collects the class name. Somehow I don't think this is quite the right fix, but it seems to work. I'm sure you can find other appropriate tweaks in any case. The display model I have in mind is that a page will contain static content that may include (presentation) MathML, and one or more math input areas (equation editors) where the markup is constantly changing. So I let MathJax do its thing when the page loads, and then make MathJax calls each time the editor input changes. But I admit my level of control over MathJax still feels a bit naive. What would be really nice would be the ability to reach inside a jax, replace a presentation subtree, and have MathJax update only what changes, rather than the entire jax, but there doesn't seem to be an API call for that, and I wouldn't expect one to be easy to add. Sam |
Thanks Sam. You patch looks good to me. Some remarks:
I'm not sure why. Perhaps a sync issue. Are you creating the className via javascript?
Yes I'm afraid this could really be properly done via Native MathML implementation. |
@samdooley could you make a pull request to |
@samdooley actually scratch that. @dpcv has a broader fix in mind. |
@pkra I'm curious about the broader fix - would it apply to core MathJax processing, similar to how the |
The broader fix would be to use the same approach as is used in tex2jax and ascimath2jax, where you can use classes to control the processing. There would be an ignore class and a process class that would allow you to turn off and on the processing of MathML within the document. This would make all three input format consistent in how they are controlled. RIght now the MathML has no control over which elements are processed by MathJax. |
Is there a status update on this mathml2jax ignore? I cant find it in the current docs. |
This issue is marked |
It would be useful to allow a class name of elements whose contents should NOT be processed by mml2jax, similar to the tex2jax option. The use case I have in mind is to allow MathJax to process presentation MathML fragments in a page, while allowing other tools to process the content MathML in the page.
Here's a patch file for MathJax 2.2 that implements the support for ignoreClass.
Thanks,
Sam Dooley
From 9f4a491a68bc7fd49709363acb3d5470e87b6964 Mon Sep 17 00:00:00 2001
From: Sam Dooley sam.dooley@pearson.com
Date: Thu, 20 Jun 2013 13:21:35 -0600
Subject: [PATCH] Added ignoreClass to mml2jax configuration options
---
unpacked/extensions/mml2jax.js | 28 ++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)
The text was updated successfully, but these errors were encountered: