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
  • #3016
Closed
Open
Issue created Mar 13, 2023 by Daisy@Daisy1213

use mathjax3 in andriod5 show error "getExplicit of null"

Issue Summary A summary of the issue and the browser/OS environment in which it occurs. If suitable, include the steps required to reproduce the bug.

Steps to Reproduce: This is the first step This is the second step Further steps, etc. Any other information you want to share that is relevant to the issue being reported. Especially, why do you consider this to be a bug? What do you expect to happen instead?

Technical details: MathJax Version: 3.2 Client OS: Mac OS X 11.5.2 I am using the following MathJax configuration:

window.MathJax = {
    chtml: {
      matchFontHeight: false,
      mtextInheritFont: false
    },
    options: {
      renderActions: {
        addMenu: [],
        checkLoading: []
      },
      skipHtmlTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code', 'a'],
      includeHtmlTags: {
        br: '\n',
        wbr: '',
        '#comment': ''
      },
      ignoreHtmlClass: 'tex2jax_ignore',
      processHtmlClass: 'tex2jax_process'
    },
    tex: {
      inlineMath: [['<latex>', '</latex>'], ['$', '$'], ['_mathjax_','_mathjax_'], ['$','$'], ['$$','$$'], ['\\(','\\)']],
      displayMath: [],
      macros: {
        ykparallelogram: '\\unicode{x25B1}',
        ykparallel: '//'
      },
      autoload: {
        color: [],
        colorV2: ['color']
      },
      packages: {
        '[+]': ['trap-undefined'],
        '[-]': ['noundefined']
      }
    },
    loader: {
      load: ['[tex]/noerrors']
    },
    startup: {
      ready: function () {
        var tex = null;

        var Configuration = MathJax._.input.tex.Configuration.Configuration;
        var TexError = MathJax._.input.tex.TexError.default;
        Configuration.create('trap-undefined', {
          fallback: {
            macro: function (parser, cs) {
              tex.inputData.codecogs = true;
            },
            environment: function (parser, env) {
              tex.inputData.codecogs = true;
            }
          }
        });

        var toDOM = function (math, node, html) {
          this.setDocument(html);
          if (math.inputData.codecogs) {
            var adaptor = html.adaptor;
            if (math.display) adaptor.setAttribute(node, 'display', true);
            var imageNode = adaptor.node('img', {
              src: 'https://gallery.fbcontent.cn/latex?decode=false&fontSize=34&latex=' + encodeURIComponent(math.math.trim() + '\\quad'),
              alt: tex.math.trim()
            })
            imageNode.onload = function () {
              imageNode.style.height = imageNode.naturalHeight / 2 + 'px'
              imageNode.style.width = imageNode.naturalWidth / 2 + 'px'
            }
            html.adaptor.append(node, imageNode);
            math.display = null;
          } else {
            this._toDOM(math, node, html);
          }
        };

        var getOutputJax = MathJax.startup.getOutputJax;
        MathJax.startup.getOutputJax = function () {
          var output = getOutputJax();
          output._toDOM = output.toDOM;
          output.toDOM = toDOM;
          return output;
        }

        MathJax.startup.defaultReady();

        MathJax.startup.input[0].preFilters.add(function (filter) {
          var math = filter.math
          tex = math
        });

        MathJax.startup.output._toDOM = MathJax.startup.output.toDOM;
        MathJax.startup.output.toDOM = toDOM;

      }
    }
  }

and loading MathJax via

Sorry, I need your help! I have an issue with the same problem,but I check my polyfill.js , It's not the same thing. please help me review this file: https://xyst.yuanfudao.com/h5/solar-web-resultspage/polyfill.js

Assignee
Assign to
Time tracking