HTML angle brackets are getting stripped off, need help please

HTML angle brackets are getting stripped off, need help please

by Dan Sy -
Number of replies: 16

Hi. I am having a problem with our system where html tags are getting stripped off.  This happens whenever we import course contents. I don't have control of the server so I can't do much on the server-side at the moment.

Some details,

  • we are using Moodle 2.8.3
  • I believe the hosting is using CentOS 6
  • PHP should be the latest version already
  • we are using the Essentials theme, not sure if this is relevant

I am trying to find at least a work-around until a solution is identified. But so far, I've been unable to find a way to create new courses without destroying all the formatting.

Would be grateful for any advise. My stress level has just peaked with about 26 new courses to be created. sad

Average of ratings: -
In reply to Dan Sy

Re: HTML angle brackets are getting stripped off, need help please

by Just H -

Importing course content from what/where and what type of content?

Sounds like you're cutting an pasting into ATTO/TinyMCE, if so, ensure you paste into HTML i.e. in ATTO click this button:



In reply to Just H

Re: HTML angle brackets are getting stripped off, need help please

by Dan Sy -

Hi. I'm importing an entire course, not just text (in a text editor).  An example of a section of the course that shows the brackets missing,

div class="contentafterlink dimmed_text" div class="no-overflow" div class="no-overflow" ul lispan style="color: #0000ff;"strongUpload your assignment here./strong/span/li lispan style="color: #0000ff;"span style="background-color: #ffff99;"strongDue embefore/em 31 March @ 9am/strong/span........

Basically all the angle brackets are gone.

In reply to Dan Sy

Re: HTML angle brackets are getting stripped off, need help please

by Just H -

Again, take a step back and tell people exactly what you are doing/trying to do or no one will be able to help.

Importing an entire course from what/where... a Moodle backup, another Moodle install, other software, if so what. How are you trying to "import"?

Without concise information we're all just guessing.

In reply to Just H

Re: HTML angle brackets are getting stripped off, need help please

by Dan Sy -

I am creating a new course, and then importing the content of a previous course.


Hope that helps? smile

In reply to Just H

Re: HTML angle brackets are getting stripped off, need help please

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Or, completely avoid these so called "text editors" * and select "Plain text area" as the Text editor in your profile.

* "text editor" https://moodle.org/mod/forum/discuss.php?d=311325#p1246274
In reply to Visvanath Ratnaweera

Re: HTML angle brackets are getting stripped off, need help please

by Dan Sy -

Thanks for the advice but it just makes for a boring content. Especially with pages that I've already created with full on tags. smile

In reply to Dan Sy

Re: HTML angle brackets are getting stripped off, need help please

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Surprise, surprise:!The plain text area is HTML!
(Just like the text editor is not text editor wink
Attachment plain-text-area.png
In reply to Visvanath Ratnaweera

Re: HTML angle brackets are getting stripped off, need help please

by Dan Sy -

Lol... I see what you mean. ;)  Thanks for that. smile

In reply to Dan Sy

Re: HTML angle brackets are getting stripped off, need help please

by Dan Sy -

Additional information to help clarify what I'm doing.

I currently have a course that I want to duplicate for another batch of students. Normally, I would do this by creating a course and then importing like so,


In the original course, the contents looks exactly how I've formatted it, with all the links, bolds, images, etc. However, in the new copy of the course, all the angle brackets from the tags have been stripped off.

And no, I have not done anything yet on any text editor. We are currently still using TinyMCE but this happens right after importing, no chance to edit anything yet.

Hopefully that clears it up a bit.

In reply to Dan Sy

Re: HTML angle brackets are getting stripped off, need help please

by Just H -

Cool, no guessing now smile

Can't say I've ever used "import" (so off to read up on it), for what you're wanting to do I normally "restore" the course I want to copy. Worth giving that a try see if it works for you.

In reply to Just H

Re: HTML angle brackets are getting stripped off, need help please

by Dan Sy -

Lol... I normally do an import rather than a restore. But yes, restore option also doesn't work.

The reason I do an import is that a restore will need a backup done first before you can restore whereas an import will create a copy (or at least I believe that is what it looks like).  I also simply create the course and let the tutors/lecturers themselves import the course as they know more about which one would be the latest version.

In reply to Dan Sy

Re: HTML angle brackets are getting stripped off, need help please

by Ken Task -
Picture of Particularly helpful Moodlers

The screen shot shows in a course and using the 'import' link there, but you don't describe what options are chosen after that.

Are you clicking the button that says 'Jump to Final Step' with all items checked?

Which are you including: activities and resources, blocks, filters, calendar events, question bank?

What happens if only activities and resources are checked and the others are not checked?

'spirit of sharing', Ken


In reply to Ken Task

Re: HTML angle brackets are getting stripped off, need help please

by Dan Sy -

Hi Ken. Yes, I simply use the defaults and jump to final step. I haven't tried to cut down on the options as I've created a completely new course with some text and tried to import it. It was behaving the same, stripping out the tags.

I will try to do it again and remove almost all options and see how it goes. Thanks for the idea. smile

In reply to Dan Sy

Re: HTML angle brackets are getting stripped off, need help please

by Ken Task -
Picture of Particularly helpful Moodlers

I tested the 'import' on a 2.8.5+ (Build: 20150319) from a hidden course and imported  just the resources and activities.  It had no ill affect such as you've described.  

Did NOT select blocks, filters, calendar events, question bank.   In anything that involves filters on site used were left at defaults.  From the behavior you are experiencing, I'd guess it has something to do with filters.   Have any addtional filters installed?

'spirit of sharing', Ken

In reply to Ken Task

Re: HTML angle brackets are getting stripped off, need help please

by Dan Sy -
Hi Ken. We are now looking at the possibility that the CentOS on which the Moodle is installed in as a possibility as the source of the problem. I know it shouldn't as it should be platform independent but an initial test on the latest version of CentOS 6.5 seems to have resolved the issue.  Our provider will be doing a transfer of the system soon so hopefully that will resolve the problem. Will update when it goes live. smile
In reply to Dan Sy

Re: HTML angle brackets are getting stripped off, need help please

by Dan Sy -

As a final confirmation that an upgrade from CentOS 6 to CentOS 6.5 has solved the issue for us. I am not sure where the platform-specific issue is coming from as Moodle should platform independent. But anyways, its currently rectified for the html stripping issue. smile

Next problem is Turnitin can't submit. lol...  Cheers everyone for the help!

Average of ratings: Useful (2)