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

HTML audio tag removed from forum post

XMLWordPrintable

    • MOODLE_30_STABLE
    • MOODLE_30_STABLE, MOODLE_31_STABLE
    • MDL-54847-master
    • Hide
      1. Create a course with a forum activity
      2. Create a topic in the forum
      3. Reply to the discussion:
        1. Put atto in HTML mode
        2. Paste:

          <video controls width="640" height="480"><source src="http://cameron1729.xyz/prettygood.mp4">
          Oh no!
          </video>

        3. Switch back to wysiwyg mode
        4. Ensure you see the embedded video and can play it
        5. Post the reply
      4. View the reply and verify you see the embedded video
      5. Edit the reply
      6. Verify you see the video in the wysiwyg preview
      7. Check the HTML view, verify the markup is still OK (controls may have changed to controls="", that's OK
      8. Make another reply with the following:

        <audio controls><source src="http://cameron1729.xyz/alienpls.wav">
        Oh no!
        </audio>

      9. Check again that you can play the wav file in the wysiwyg editor as well as after saving the reply
      Show
      Create a course with a forum activity Create a topic in the forum Reply to the discussion: Put atto in HTML mode Paste: < video controls width = "640" height = "480" >< source src = "http://cameron1729.xyz/prettygood.mp4" > Oh no! </ video > Switch back to wysiwyg mode Ensure you see the embedded video and can play it Post the reply View the reply and verify you see the embedded video Edit the reply Verify you see the video in the wysiwyg preview Check the HTML view, verify the markup is still OK ( controls may have changed to controls="" , that's OK Make another reply with the following: < audio controls>< source src = "http://cameron1729.xyz/alienpls.wav" > Oh no! </ audio > Check again that you can play the wav file in the wysiwyg editor as well as after saving the reply
    • 3
    • 3.2 Sprint 3

      A user wishes to embed a .wav file into a forum post. Adding the .wav file via the text editor's media button only inserts a hyperlink to the file (see MDL-54846). Using the text editor's source mode, the user attempts to embed the uploaded .wav file using the HTML 5 audio tag. However, upon saving, the audio tag is automatically removed so the file is not embedded. Using the same code in a page resource, the audio tag is not removed.

      STEPS TO REPLICATE

      1. Create a forum activity.
      2. Add a new post to the forum.
      3. Click the Media button on the text editor.
      4. Upload a .wav file and then click the insert media button. The .wav file is added to the page as a hyperlink.
      5. Click the HTML button on the text editor to switch into source mode.
      6. Update the HTML using the HTML 5 audio tag to embed the .wav file into the page. Same code:

      <p>The wav file should be embedded.</p>
      <audio controls>
      <source src="http://core2next-sandbox.mrooms.net/draftfile.php/612/user/draft/162587154/a2002011001-e02.wav" type="audio/wav">
      Your browser does not support the audio element.
      </audio>
      

      7. Submit the post.
      8. Read the post. Also edit the post and click the HTML button on the text editor.

      OBSERVED BEHAVIOR:
      The .wav file is not embedded in the HTML. The audio tag has been removed. The resulting HTML:

      <p>The wav file should be embedded.</p>Your browser does not support the audio element.
      

      EXPECTED BEHAVIOR:
      The audio tag is retained in the HTML. The .wav file is embedded into the forum post allowing the audio file to be played directly from the post.

      REPLICATION LOCATIONS
      Behavior has been replicated in 3.0.4 and 2.9.3.

      ADDITIONAL INVESTIGATION NOTES
      1. The audio tag is removed from the forum post HTML regardless of the file type being embedded. For example, attempting to embed an .mp3 file with the audio tag also results in the audio tag being removed.
      2. Behavior was replicated with both the Atto and TinyMCE text editors.

      USER IMPACT
      An instructor teaching a sound design course would like for students to be able to share their .wav files within forums. The .wav file format is not among the file formats currently handled by Moodle's media embedding features (see MDL-54846). A potential work-around would be manually entered the necessary HTML to embed the file, but this cannot be done when the audio tag is automatically removed.

            cameron1729 cameron1729
            brian.winstead Brian Winstead
            Adrian Greeve Adrian Greeve
            Dan Poltawski Dan Poltawski
            Damyon Wiese Damyon Wiese
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

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