Picture of Marissa Preciado
CKEditor HTML
by Marissa Preciado - Friday, 2 August 2019, 6:21 PM
 

Hi, 

The CK editor stips out my HTML even when I have edited the config.json to read:  "ckEditorExtraAllowedContent": "span(*)[data-*,onmouseenter];*(*);button[name]"

Am I missing something or does it need to be changed somewhere else?

I'm using version 0.9.0 of the Authoring Tool.

 

Thank you.

Picture of Simon Date
Re: CKEditor HTML
by Simon Date - Monday, 12 August 2019, 7:30 AM
 

Hi Marissa,

Whenever a change is made to the Authoring Tool it needs to be rebuilt to apply. Did you run grunt build?

Thanks,

Simon

Picture of Marissa Preciado
Re: CKEditor HTML
by Marissa Preciado - Tuesday, 20 August 2019, 6:12 PM
 

I did and it still does not work.

Picture of Lars Halkjær
Re: CKEditor HTML
by Lars Halkjær - Tuesday, 20 August 2019, 9:09 PM
 

I could not get it to work either, but after a bit of debugging I found that this "hack" seems to work:

In the file "adapt_authoring/frontend/src/modules/scaffold/backboneFormsOverrides.js" I made these changes (between the "allow all content - start" and "allow all content - end" comments):

    _.defer(function() {
      this.editor = CKEDITOR.replace(this.$el[0], {
        dataIndentationChars: '',
        disableNativeSpellChecker: false,
        enterMode: CKEDITOR[Origin.constants.ckEditorEnterMode],
        entities: false,
// allow all content - start
        allowedContent:{
          $1:{
            elements: CKEDITOR.dtd,
            attributes: true,
            styles: true,
            classes: true
          }
        },
// allow all content - end
        // extraAllowedContent: Origin.constants.ckEditorExtraAllowedContent,
        on: {
          change: function() {

After a rebuild of the AT the filtering is gone.

 

Picture of Marissa Preciado
Re: CKEditor HTML
by Marissa Preciado - Tuesday, 20 August 2019, 10:07 PM
 

This is amazing! It is now working. Thank you so much!

Picture of Jonathan Briggs
Re: CKEditor HTML
by Jonathan Briggs - Wednesday, 21 August 2019, 9:11 AM
 

Hi, I've been trying to get this sorted for ages - but the above isn't working for me. Is the line after

// allow all content - end

intended to be commented out?

Thanks,

Jonathan

Picture of Lars Halkjær
Re: CKEditor HTML
by Lars Halkjær - Wednesday, 21 August 2019, 9:51 AM
 

Yes, that is intentional.

I figured that since the inserted lines removes any filtering, you do not need to specify what is allowed.

A personal experience: On one of our servers I forgot to run "grunt build:prod" after making the change - could this be it?