Project: moodle
Issue MDL-54847: HTML audio tag removed from forum post
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: {noformat}

The wav file should be embedded.

Your browser does not support the audio element. {noformat}	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: {noformat}

The wav file should be embedded.

Your browser does not support the audio element. {noformat} 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.
Story points: 3