Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-video embed iframe is always treated as a video embed #831

Closed
rwaldron opened this issue Jul 28, 2021 · 2 comments
Closed

Non-video embed iframe is always treated as a video embed #831

rwaldron opened this issue Jul 28, 2021 · 2 comments
Milestone

Comments

@rwaldron
Copy link
Contributor

Describe the bug

I have users that expect to be able to embed things like Google Forms or Qualtrics Surveys via iframe. When doing so, the <iframe> markup is treated as a video embed and subsequently wrapped in the video embed markup.

To Reproduce
Steps to reproduce the behavior:

  1. Using an editor that has code view, click the code view icon.
  2. Select all and paste the following:
<iframe src="https://docs.google.com/forms/d/e/1FAIpQLSdeRUNjzg9b276CGcT0gHWzrp1bRdx6ssfWU0Pje9K3dCCeJQ/viewform?usp=sf_link" style="width: 1920px; height: 1080px;"></iframe>
  1. Click the code view button again to see the rendered frame
  2. Click the code view button again to see the modified markup
<div class="se-component se-video-container __se__float-none" contenteditable="false">
  <figure style="height: 1080px; padding-bottom: 1080px; margin: 0px; width: 1920px;">
    <iframe src="https://docs.google.com/forms/d/e/1FAIpQLSdeRUNjzg9b276CGcT0gHWzrp1bRdx6ssfWU0Pje9K3dCCeJQ/viewform?usp=sf_link" style="width: 1920px; height: 1080px;" frameborder="0" allowfullscreen="" data-size="1920px,1080px" data-align="none" data-index="1" data-file-name="viewform?usp=sf_link" data-file-size="0" data-origin="1920px,1080px"></iframe>
  </figure>
</div>

Expected behavior

My users expect their <iframe ...></iframe> to be left alone, however I would argue that such an expectation is not yet defined, but probably should be, ie. there should be some way to signal to SunEditor that it must leave a given iframe alone.

I can think of two possible ways to handle this, (though I'm sure you have more and better ideas 😄 ):

  1. Only create the wrapper markup when the actual SunEditor Video embed plugin is used. This is probably too drastic.
  2. Create a special data-* attribute that can be used by "power users" to override the video wrapper, ie. <iframe data-se-video-embed="false" src="..."></iframe>
@JiHong88 JiHong88 added this to the 2.42.0 milestone Aug 8, 2021
@s-kris
Copy link

s-kris commented Oct 10, 2021

@JiHong88

For me, In addition to the issue mentioned by @rwaldron, the src attribute is removed. I whitelisted the attribute but still, the src is removed.

 attributesWhitelist: {
                    iframe: 'src',
                },

Am I missing something here?

Thank you!

update: (how to reproduce the error)

  1. Click codeView button
  2. Add an iframe into editor
  3. Save the contents of the editor (local or server)
  4. Reload the page
  5. Set contents of editor (from local or server saved in step 很不错,关注ing #3)
  6. Click codeView button

You can see that src attribute is removed.

JiHong88 added a commit that referenced this issue Nov 22, 2021
@JiHong88
Copy link
Owner

The 2.42.0 version has been updated.
If this issue has not been resolved, please reopen this issue.
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants