0fc8ce19f7
closes LS-1601 flag=new_math_equation_handling The previous approach was to replace the equation image with the equation's LaTeX in canvas' backend, but not all user content sent to the browser passes through UserContent.escape. Discussions and legacy quiz questions included. The backend approach also suffered from the an ugly visual where the LaTeX is displayed onscreen until MathJax typesets it. In a previous commit, I caught Discussion replies in apiUserContent where the screenreader assistive mathml is injected into the DOM adjacent to the image. That worked but we now had 2 places where the replacement was taking place, and quiz questions are still being missed. A better approach is to handle it all in a central location, which is with the code that detects math is on the page. The new approach is to inject the LaTeX into the DOM adjacent to the image just before MathJax does its processing, then removes the image when it finished. This way the equation image is displayed to the user while MathJaX does its work, and since we look for new math in a MutationObserver watching the whole document, we never miss any equation images on the page. Because we are looking for mutations anywhere on the page, there may be nodes we want to ignore (e.g. the quiz timer). This is handled by adding to the ignore_list css selector in main.js test plan: - with the "Updated math equation handling" flag on (and optionally 'Support LaTex math equations almost everywhere") - double check that equations created with the rce equation editor are processed with mathjax all over canvas > expect equation images to be visible until replaced by MathJax typeset versions - Discussions: - reply to a discussion with an equation (inline and equation editor) > expect them to be typeset by mathjax - edit a reply and save > expect the the reply to have it's math processed by mathjax - Legacy Quizzes - create a quiz, set it so 1 question per page - add a couple questions with equations - preview the quiz, moving forward and back thru the questions > expect the questions go have their equations typeset by mathjax Change-Id: I9e2ec4fd53de06748156bbd4adadac7e2b1e205f Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/252222 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Jackson Howe <jackson.howe@instructure.com> QA-Review: Robin Kuss <rkuss@instructure.com> Product-Review: Peyton Craighill <pcraighill@instructure.com> |
||
---|---|---|
.github | ||
Gemfile.d | ||
app | ||
bin | ||
build | ||
client_apps | ||
config | ||
db/migrate | ||
doc | ||
docker-compose | ||
frontend_build | ||
gems | ||
hooks | ||
jest | ||
lib | ||
log | ||
packages | ||
pact | ||
public | ||
script | ||
spec | ||
tmp | ||
.bowerrc | ||
.codeclimate.yml | ||
.dive-ci | ||
.dockerignore | ||
.editorconfig | ||
.eslintignore | ||
.eslintrc.js | ||
.gitignore | ||
.gitmessage | ||
.i18nignore | ||
.i18nrc | ||
.lintstagedrc.js | ||
.npmrc | ||
.nvmrc | ||
.prettierrc | ||
.rubocop.yml | ||
.stylelintrc | ||
.travis.yml | ||
CONTRIBUTING.md | ||
COPYRIGHT | ||
Dockerfile | ||
Dockerfile.githook | ||
Dockerfile.jenkins | ||
Dockerfile.jenkins-cache | ||
Dockerfile.package-translations | ||
Gemfile | ||
Jenkinsfile | ||
Jenkinsfile.cassandra | ||
Jenkinsfile.contract-tests | ||
Jenkinsfile.dive | ||
Jenkinsfile.docker-smoke | ||
Jenkinsfile.dynamodb | ||
Jenkinsfile.js | ||
Jenkinsfile.master-bouncer-check-all | ||
Jenkinsfile.package-translations | ||
Jenkinsfile.parallel_logs | ||
Jenkinsfile.postgres | ||
Jenkinsfile.redis | ||
Jenkinsfile.selenium.flakey_spec_catcher | ||
Jenkinsfile.selenium.performance.chrome | ||
Jenkinsfile.test-subbuild | ||
Jenkinsfile.vendored-gems | ||
Jenkinsfile.xbrowser | ||
LICENSE | ||
README.md | ||
Rakefile | ||
babel.config.js | ||
bower.json | ||
code_of_conduct.md | ||
config.ru | ||
docker-compose.new-jenkins-contract-tests.yml | ||
docker-compose.new-jenkins-flakey-spec-catcher.yml | ||
docker-compose.new-jenkins-karma.yml | ||
docker-compose.new-jenkins-package-translations.yml | ||
docker-compose.new-jenkins-selenium.yml | ||
docker-compose.new-jenkins.canvas.yml | ||
docker-compose.new-jenkins.consumer.yml | ||
docker-compose.new-jenkins.vendored-gems.yml | ||
docker-compose.new-jenkins.yml | ||
docker-compose.spring.yml | ||
docker-compose.yml | ||
gulpfile.js | ||
issue_template.md | ||
jest.config.js | ||
karma.conf.js | ||
package.json | ||
ubuntu.development.Dockerfile | ||
ubuntu.production.Dockerfile | ||
webpack.config.js | ||
webpack.test.config.js | ||
yarn.lock |
README.md
Canvas LMS
Canvas is a modern, open-source LMS developed and maintained by Instructure Inc. It is released under the AGPLv3 license for use by anyone interested in learning more about or using learning management systems.
Please see our main wiki page for more information
Installation
Detailed instructions for installation and configuration of Canvas are provided on our wiki.