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

Moodle WYSIWYG editor breaks JavaScript syntax for arrow functions on loading

XMLWordPrintable

    • MOODLE_402_STABLE

      Inside a simple moodle text page (content element)  I'm using a javascript with a callback function noted in the form of an arrow function that relies on having the string "=>" in unaltered form.

      On loading the said text page the WYSIWYG editor inserts a blank in between to form "= >" effectively breaking the code. 

      Steps for reproduction:

      1. Create a text page inside a Moodle course.
      2. Open the source code view inside the HTML Editor and add (a Javascript containing the code string) "=>"
      3. Save
      4. Edit once more
      5. Find that the code has been changed to "= >"

      Expected behaviour: Keep Javascript code in unaltered form "=>"

      Observed behaviour: Code changed automatically to "= >" on loading a page into the editor

      Versions affected: I had to select the current release version because the form forced me to do so. I cannot determine the version of the Moodle instance I use. None of the ways described in https://docs.moodle.org/402/en/Moodle_version is applicable since the footers have been changed not to contain the MoodleDocs links and I have neither admin nor console access to the server.

            Unassigned Unassigned
            ceeee Ceeee
            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.