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

MathJax filter breaks text display when custom delimiters used

    XMLWordPrintable

    Details

    • Testing Instructions:
      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".)
    • Affected Branches:
      MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_30_STABLE, MOODLE_31_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      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

              • Assignee:
                bostelm Henning Bostelmann
                Reporter:
                bostelm Henning Bostelmann
                Peer reviewer:
                Adrian Greeve
                Integrator:
                Dan Poltawski
                Tester:
                Marina Glancy
                Participants:
                Component watchers:
                Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  12/Sep/16