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

MathJax filter breaks text display when custom delimiters used

    XMLWordPrintable

Details

    • MOODLE_32_STABLE
    • MOODLE_30_STABLE, MOODLE_31_STABLE
    • Hide
      • Log in as administrator.
      • In the system configuration, enable the MatJax filter and modify its configuration options as follows:
        • Additional equation delimiters: $
        • MathJax configuration: Replace the line

          messageStyle: "none"
      

      with

          messageStyle: "none",
          tex2jax: {
            inlineMath: [ ['$','$'], ['\\(','\\)'] ]
          }
      

      • Go to a course (create an empty one if needed)
      • Create a "page" resource
      • In the "Page content" field, enter:

          $x^2$
        

      • Click "Save and display"
      • VERIFY: The page content is rendered as "x²" (x squared).

      (Incorrect behaviour without the patch: the page content is rendered as "0".)

      Show
      Log in as administrator. In the system configuration, enable the MatJax filter and modify its configuration options as follows: Additional equation delimiters: $ MathJax configuration: Replace the line messageStyle: "none" with messageStyle: "none", tex2jax: { inlineMath: [ ['$','$'], ['\\(','\\)'] ] } Go to a course (create an empty one if needed) Create a "page" resource In the "Page content" field, enter: $x^2$ Click "Save and display" VERIFY: The page content is rendered as "x²" (x squared). (Incorrect behaviour without the patch: the page content is rendered as "0".)

    Description

      I'll try to keep this one short. On current master, when the Mathjax filter is used with "additional delimiters", it will break text output and return only "0" instead of the text to be filtered.

      This is a regression of MDL-55007. The change uses "plus" as string concatenation operator in moodle/filter/mathjaxloader/filter.php, line 164. Evidently, it should be "dot" .

      Patch to follow.

      Attachments

        Issue Links

          Activity

            People

              bostelm Henning Bostelmann
              bostelm Henning Bostelmann
              Adrian Greeve Adrian Greeve
              Dan Poltawski Dan Poltawski
              Marina Glancy Marina Glancy
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                12/Sep/16