Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fixes Mathjax inside of a cloze replacement. #5324

Merged
merged 1 commit into from
Jun 11, 2019

Conversation

adamwolf
Copy link
Contributor

Pull Request template

Purpose / Description

Mathjax wasn't being rendered inside of cloze replacements. I tracked it down to clozeText() which was eating the backslashes needed for \(.

Fixes

#5323

Approach

Escapes the backslashes.

How Has This Been Tested?

I created a test to replicate the issue. It now passes. The old tests still pass.

Checklist

Please, go through these checks before submitting the PR.

  • You have not changed whitespace unnecessarily (it makes diffs hard to read)
  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • Your code follows the style of the project (e.g. never omit braces in if statements)
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code

@mikehardy
Copy link
Member

With a test even 💪 👍 - if/when CI goes green I'll merge, thanks @adamwolf

@mikehardy
Copy link
Member

uh-oh - a nope in CI:


com.ichi2.libanki.ClozeTest > testCloze FAILED
    java.lang.AssertionError
        at org.junit.Assert.fail(Assert.java:86)
        at org.junit.Assert.assertTrue(Assert.java:41)
        at org.junit.Assert.assertTrue(Assert.java:52)
        at com.ichi2.libanki.ClozeTest.testCloze(ClozeTest.java:51)

@adamwolf adamwolf force-pushed the aww-mathjax-in-cloze branch from 708447c to 8fae40e Compare June 11, 2019 03:23
@adamwolf
Copy link
Contributor Author

adamwolf commented Jun 11, 2019 via email

@mikehardy mikehardy merged commit 067b7f6 into ankidroid:master Jun 11, 2019
@mikehardy
Copy link
Member

mikehardy commented Jun 11, 2019

Looks good to me :-). Yeah, I've seen flaky behavior in the past from time to time but I'm fairly sure the current codebase is pretty squeaky clean. Only saying that in case it helps you search for root cause, though of course software is always surprising so I won't say 100% certain. Either way, we're green again, I'm going to merge this

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants