Skip to content

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented Jun 15, 2016

Make minus in <mn> produce U+2212 rather than U+002D. Resolve issue #989.

This also tweaks the NativeMML output; should we do that? Or make a configuration parameter to prevent that?

@pkra pkra added this to the MathJax v2.x.x milestone Jun 15, 2016
@pkra
Copy link
Contributor

pkra commented Jun 15, 2016

Resolve issue #989.

Since this came from the Content MathML extension's output, should we fix it there as well (or am I missing the fix from some earlier patch)?

This also tweaks the NativeMML output; should we do that?

I'm ok with that.

Or make a configuration parameter to prevent that?

I don't mind either way. Perhaps it's more appropriate to be in v3.0 to have an explicit "tweak MathML" option (maybe a light-weight semantic enrichment module).

@dpvc
Copy link
Member Author

dpvc commented Jun 15, 2016

should we fix it there as well

Probably. It doesn't look like anything was done about that. I'll look into it further.

Perhaps it's more appropriate to be in v3.0 to have an explicit "tweak MathML" option

Yes, that sounds good.

maybe a light-weight semantic enrichment module

I'm not sure how light-weight it is.

The current arrangement does not change the internal MathML, only the MathML entered into the page. Thus the "Show Math As..." menu shows the natural MathML, not the MathML tweaked for the particular browser (e.g., the hack we have for FF to handle mlabeledtr for example). But I guess this is a different type of thing, where the input MathML can be improved.

@dpvc
Copy link
Member Author

dpvc commented Jun 18, 2016

should we fix it there as well

OK, I added code to convert <mn>-n</mn> to <mrow><mo>&#x2212;</mo><mn>n</mn></mrow> in the content-mathml extension.

MML.mn.Augment({
SVGremapMinus: function (text) {return text.replace(/^-/,"\u2212")},
toSVG: function () {
this.SVGgetStyles();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I see the indentation problem here.

@zorkow
Copy link
Member

zorkow commented Jul 8, 2016

I'd suggest a single utility function for the replacement of minus.
Also native/mml/svg is effectively 3 times the same code. Would it be worth the effort to combine those into a common utility method? Would make it easier to maintain.

@dpvc
Copy link
Member Author

dpvc commented Jul 8, 2016

Do you mean the function (text) {return text.replace(/^-/,"\u2212")},? I'm not particularly worried about repeating this small function. There turns out to be a lot of overlap among the three (or sometimes four) main output jax, and it is true that that duplication could be refactored. It grew out of the fact that the initial two output jax were HTML-CSS and NativeMML, and they had very little overlap. The addition of SVG made some of the duplication apparent, and now CommonHTML has made more of that. I think it is probably not cost-effective to refactor for 2.x, but should do so for 3.0.

@zorkow
Copy link
Member

zorkow commented Jul 23, 2016

OK, I am fine with that.
LGTM.

@dpvc dpvc merged commit 119f050 into mathjax:develop Jul 23, 2016
@dpvc dpvc deleted the issue989 branch July 23, 2016 19:45
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

Successfully merging this pull request may close these issues.

3 participants