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

Opt-out for some file types #32

Open
alf239 opened this issue Apr 10, 2020 · 1 comment
Open

Opt-out for some file types #32

alf239 opened this issue Apr 10, 2020 · 1 comment

Comments

@alf239
Copy link

alf239 commented Apr 10, 2020

Scala's diffs are a mess with the plugin: when you have an interpolated srting, it is likely to have some $s in it, and those are treated as \LaTeX which is a bit strange in the context.

Is there a way to suppress MathJax processing for specific file types?

@alf239
Copy link
Author

alf239 commented Apr 11, 2020

The MathJax.Hub.Typeset() command also accepts a parameter that is a DOM element whose contents is to be typeset. That could be a paragraph, or a <div> element, or even a MathJax math <script> tag. It could also be a the DOM id of such an object, in which case, MathJax will look up the DOM element for you. So

MathJax.Hub.Queue(["Typeset",MathJax.Hub,"MathExample"]);

would typeset the mathematics contained in the element whose id is MathExample. This is equivalent to

var math = document.getElementById("MathExample");
MathJax.Hub.Queue(["Typeset",MathJax.Hub,math]);

If no element or element id is provided, the whole document is typeset.

And it seems that the Scala sources can be identified by an attribute data-file-type=".scala" in a div that's before the parent div with class js-file-content Details-content--hidden

alf239 added a commit to alf239/github-mathjax that referenced this issue Apr 13, 2020
alf239 added a commit to alf239/github-mathjax that referenced this issue Apr 13, 2020
alf239 added a commit to alf239/github-mathjax that referenced this issue Apr 13, 2020
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

1 participant