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
  • Issues
  • #3024
Closed
Open
Issue created Mar 17, 2023 by sunny@cbsunny

When catching data-mjx-error attribute exceptions, when the content of the formula changes, the last exception will reappear. How to clear the cache?

Is your feature request related to a problem? Please describe. For example, to update the content of the formula, the previous exception will also be triggered when the current content is rendered

Describe the solution you'd like Hope to clear the exception that occurred last time.

Additional context

MathJax = {
  options: {
    renderActions: {
      handleErrors: [199,
        (doc) => {for (const math of doc.math) MathJax.config.handleError(math)},
        (doc, math) => MathJax.config.handleError(math)
      ]
    }
  },
  handleError(math) {
    const node = math.root.childNodes[0];
    console.log('>>>>>>>>>>>>>>>>>handleError', math.math.trim(), window._questionImageId, window._questionToken)
    if (node && node.childNodes[0] && node.childNodes[0].attributes.get('data-mjx-error')) {
      window.sendMessage && window.sendMessage('/event/check-apollo/dataMjxError', {
            pageName: 'check',
            codecogs: math.inputData.codecogs,
            latex: math.math.trim(),
            queryId: window._questionQueryId,
            imageId: window._questionImageId,
            questionToken: window._questionToken
          })
    }
  }
};
0 1
Assignee
Assign to
Time tracking