Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • M MathJax
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 304
    • Issues 304
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 15
    • Merge requests 15
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • MathJax
  • MathJax
  • Merge requests
  • !1395

Don't die if script has been removed from document

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/uhoreg/patch-1 into master Feb 19, 2016
  • Overview 2
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: uhoreg

On our site, which displays a live preview of math as users type it in, it appears that if users type too fast, MathJax will die and not display any more math. In the console, it complains that "b.parentNode is null". This patch checks b.parentNode (a.k.a. script.parentNode in the non-minified version) before calling b.parentNode.insertBefore().

I suppose it would be better to check script.parentNode earlier in the process so that MathJax doesn't waste time processing something that won't be displayed, but this patch seems to work, and should probably be done anyways.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/uhoreg/patch-1