Lesson

 
 
Picture of Graham Paull
Lessons Stripping HTML
 

Hi,

I have a quick question regarding the Lessons Activity Module within Moodle 2:

When I create a new content page within a lesson, I will paste over some HTML, this HTML is literally for silly things like Bullet Pointing and table formatting etc, when I have the editor open I can see how it should look but when I save this and view it all the HTML formatting is removed. When I go in to edit this content page again I can see that the formatting HTML is still within the code.

Is there anything I can do to keep the formatting so that when I view the lesson I will see all the formatting.

I have full access to the back-end code so if there is anything I need to change I am happy to do so.

Moodle 2.4.1+

TIA,

 

Graham

 
Average of ratings: -
Picture of Joseph Rézeau
Re: Lessons Stripping HTML
Group DevelopersGroup Particularly helpful MoodlersGroup TestersGroup Translators

Hi Graham,

Normally, you should never copy-paste HTML code into Moodle's TinyMCE HTML editor. You should copy raw text and format it using Moodle's TinyMCE HTML editor's formatting tools.

Joseph

 
Average of ratings: -
Picture of Graham Paull
Re: Lessons Stripping HTML
 

Hi Joseph,

Thanks for that but even if I paste in or type in plain text and format it from within the editor and save it then it strips out all the formatting, I am not sure if this is a bug or a feature but it certainly seems like a bug to me.

Slowly giving up.

Thanks,

G

 
Average of ratings: -
Picture of Joseph Rézeau
Re: Lessons Stripping HTML
Group DevelopersGroup Particularly helpful MoodlersGroup TestersGroup Translators

Graham "...even if I paste in or type in plain text and format it from within the editor and save it then it strips out all the formatting"

This is different from what you said in your first post, and it should not happen. Are you having this problem ONLY with the Lesson content pages or in other Moodle activities where you use the HTML editor?

Joseph

 
Average of ratings: -
Picture of Graham Paull
Re: Lessons Stripping HTML
 

Joseph,

Apologies if I messed that up, too late to edit it.

I just tried again to add some plain text with some bullet points, I saved and it removed the bullet points so it is definitely removing the formatting.

I created a label and added some text with formatting and it shows up with all formatting intact just like it should so it seems it is just within the lessons that this issue is happening.

I came across the following in the Lessons FAQ but I do not understand what it means:

"What happened to my HTML code on a Lesson page?

I had the lesson page formatted just the way I wanted by using the HTML source toggle on the tool bar. I went back in to tweak my code and some of my code was missing!

  • Lesson will "clean" up your HTML code every time you toggle into HTML text. This can be frustrating, especially if you are trying to get a flash file to display just right. Save you work in a text editor, so the next time you tweak it, you can paste all your code back in."

Thanks,

G

 
Average of ratings: -