Skip to content

Conversation

@ChristopherChudzicki
Copy link
Collaborator

Resolves #169

@ChristopherChudzicki ChristopherChudzicki force-pushed the asciimath-nowrap-overscripts branch from 03a598e to 82a9882 Compare February 23, 2019 21:47
@ChristopherChudzicki
Copy link
Collaborator Author

I forgot to update my local repo. Updated, rebased, and force-pushed. I deleted the old fix from #164

Copy link
Collaborator

@jolyonb jolyonb left a comment

Choose a reason for hiding this comment

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

Looks good to me, assuming that your javascript syntax is correct ;-) Just the one comment.

var middle = '{:' + eqn.slice(funcStart, funcEnd) + ':}'
eqn = front + middle + eqn.slice(funcEnd)
var middle = eqn.slice(funcStart, funcEnd)
eqn = front + wrapIfNotOverscript(null, middle) + eqn.slice(funcEnd)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this is unnecessary, as nothing in the set contains parentheses, and this is only called for completed functions, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

wrapFuncCalls wraps incomplete function calls:

wrapFuncCalls('cat(') // returns '{:cat:}(
wrapVariables('cat(') // returns 'cat('

Now, I'm not sure that wrapping incomplete function calls is actually necessary... I think when we encountered the issues with x'/2 and p(x)/2, we adopted "wrap everything" as a philosophy, so I wrapped incomplete function calls, too. (Overscript issues has made me question that philosophy...)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, the point was more that the old code is equivalent to the new code, unless I'm missing something?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think that the test I added for wrapFuncCalls describes how we want it to behave for overscript symbols:

https://github.com/mitodl/mitx-grading-library/pull/170/files#diff-1d7052fc002008ab0813d9d4de53d3b7R191

The middle two cases for that test require this alteration to wrapFuncCalls.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, I see now. Very good! Thanks for the clarifications. For posterity, I'll add that overline() converts to {:overline():}, which is the desired behavior, and works in AsciiMath.

@jolyonb jolyonb merged commit cbdcb77 into mitodl:master Feb 24, 2019
@ChristopherChudzicki ChristopherChudzicki deleted the asciimath-nowrap-overscripts branch June 29, 2019 00:57
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.

2 participants