Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-71745

mhchem expressions not rendered correctly

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.9.7, 3.10.4, 3.11, 4.0.5
    • None
    • Filters, Maths filters
    • MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE

    Description

      Steps to reproduce:

      • Site with MathJax and TeX filters enabled. MathJax before TeX.
      • Chemistry notation enabled in MathJax:
        https://docs.moodle.org/en/Chemistry_notation_using_mhchem#via_MathJax
      • filter_mathjaxloader | mathjaxconfig:

        MathJax.Hub.Config({
            TeX: { extensions: ["AMSmath.js", "AMSsymbols.js", "mhchem.js", "noErrors.js", "noUndefined.js"] },
            config: ["Accessible.js", "Safe.js"],
            errorSettings: { message: ["!"] },
            skipStartupTypeset: true,
            messageStyle: "none"
        });
        

      • In Moodle-course create a page and add mhchem-expressions.

      We have found most mhchem-expressions rendering correctly.
      For example:

      \(\ce{ \bond{->} }\)
      \(\ce{ -> }\)
      

      The following expressions are broken though:

      \(\ce{ \bond{<-} }\)
      \(\ce{ <- }\)
      \(\ce{ <-> }\)
      \(\ce{ <=> }\)
      \(\ce{ <=>> }\)
      \(\ce{ <<=> }\)
      \(\ce{ CO2 + C <- 2CO }\)
      \(\ce{ CO2 + C <=> 2CO }\)
      \(\ce{ H+ + OH- <=>> H2O }\)
      

      Rendering problems seem to occur only in \ce -expressions starting with "<".

      We have found that this is a regression caused by MDL-69911.
      With TeX-filter disabled or the parameter cleaning introduced by MDL-69911 commented out, the mhchem expressions are rendered correctly.

      Attachments

        Activity

          People

            Unassigned Unassigned
            schach Heiko Schach
            David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: