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

MathJax filter breaks text display when custom delimiters used

XMLWordPrintable

    • 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".)

      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.

            bostelm Henning Bostelmann
            bostelm Henning Bostelmann
            Adrian Greeve Adrian Greeve
            Dan Poltawski Dan Poltawski
            Marina Glancy Marina Glancy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.