Skip to content
This repository has been archived by the owner on Aug 21, 2020. It is now read-only.

Editor stripping iframes #34

Closed
mcrider opened this issue Jun 22, 2016 · 6 comments
Closed

Editor stripping iframes #34

mcrider opened this issue Jun 22, 2016 · 6 comments

Comments

@mcrider
Copy link

mcrider commented Jun 22, 2016

I imported a bunch of blog posts from Wordpress that have iframe embeds in them (for videos). They appear fine in apostrophe, but when i click on the editor, they all get stripped away. I set

sanitizeHtml: {
    allowedAttributes: false,
    allowedTags: false,
  },

in app.js and also set allowedContent: true like this:

'apostrophe-editor-2': {
      plugins: [
        { name: 'autocorrect', path: '/editor/plugins/autocorrect/' }
      ],
      config: {
        allowedContent: true
      }
    }

But nothing is working. Am I right in thinking that this is a CKEditor issue?

@boutell
Copy link

boutell commented Jun 22, 2016

Could be. You'd have to check what's flowing over the network as you edit
(via the network panel in chrome inspector) to know if it's ckeditor not
submitting them, or sanitizeHtml stripping them.

apostrophe-blog-2's importer is smart enough to handle video shortcodes and
turn them into separate A2 widgets. Nothing in there to handle iframes that
are hanging out in the markup though.

Our

On Wed, Jun 22, 2016 at 12:51 PM, Matt Crider notifications@github.com
wrote:

I imported a bunch of blog posts from Wordpress that have iframe embeds in
them (for videos). They appear fine in apostrophe, but when i click on the
editor, they all get stripped away. I set

sanitizeHtml: {
allowedAttributes: false,
allowedTags: false,
},

in app.js and also set allowedContent: true like this:

'apostrophe-editor-2': {
plugins: [
{ name: 'autocorrect', path: '/editor/plugins/autocorrect/' }
],
config: {
allowedContent: true
}
}

But nothing is working. Am I right in thinking that this is a CKEditor
issue?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#34, or mute the
thread
https://github.com/notifications/unsubscribe/AAB9fW8jqRxgKOJl-bBnLiLbWdGn0_Mdks5qOWf0gaJpZM4I7_it
.

*THOMAS BOUTELL, *SUPPORT LEAD
P'UNK AVENUE | (215) 755-1330 | punkave.com

@mcrider
Copy link
Author

mcrider commented Jun 22, 2016

Yeah, definitely ckeditor stripping the tags before it sends it over the network. Will investigate further.

@boutell
Copy link

boutell commented Jun 22, 2016

You might consider transforming these into Apostrophe widgets by using our
split-html module the same way we do in wordpress.js of the
apostrophe-blog-2 module.

On Wed, Jun 22, 2016 at 2:08 PM, Matt Crider notifications@github.com
wrote:

Yeah, definitely ckeditor stripping the tags before it sends it over the
network. Will investigate further.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#34 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAB9fW1U0keo5Fcndf_y0yRvJhbCT5iSks5qOXo6gaJpZM4I7_it
.

*THOMAS BOUTELL, *SUPPORT LEAD
P'UNK AVENUE | (215) 755-1330 | punkave.com

@mcrider
Copy link
Author

mcrider commented Jun 22, 2016

So if I add CKEDITOR.config.allowedContent = true; to apostrophe-editor-2/node_modules/apostrophe-editor-2/public/js/editor.js::24 everything works. Are you sure the config option passed into from app.js is being picked up by ckeditor? I don't seem to see it getting merged in anywhere.

@boutell
Copy link

boutell commented Jun 22, 2016

Not sure what option you're passing in app.js, exactly. But I just did this
successfully in a project:

'apostrophe-editor-2': {
config: {
removeButtons: 'Underline'
}
},

Note that support for this is recent in the apostrophe-editor-2 module.

On Wed, Jun 22, 2016 at 2:46 PM, Matt Crider notifications@github.com
wrote:

So if I add CKEDITOR.config.allowedContent = true; to
apostrophe-editor-2/node_modules/apostrophe-editor-2/public/js/editor.js::24
everything works. Are you sure the config option passed into from app.js is
being picked up by ckeditor? I don't seem to see it getting merged in
anywhere.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#34 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAB9fVKMLBEbeySkHqW1yVAuYJBcWnthks5qOYMOgaJpZM4I7_it
.

*THOMAS BOUTELL, *SUPPORT LEAD
P'UNK AVENUE | (215) 755-1330 | punkave.com

@mcrider
Copy link
Author

mcrider commented Jun 22, 2016

YES I had to update a couple points. Thanks again Tom!

@mcrider mcrider closed this as completed Jun 22, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants