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

Wrap images, links, iframes in double hierarchy #28

Open
PostMidnight opened this issue Apr 11, 2019 · 2 comments
Open

Wrap images, links, iframes in double hierarchy #28

PostMidnight opened this issue Apr 11, 2019 · 2 comments

Comments

@PostMidnight
Copy link

If an iframe / img or are detected, they should be wraped as follows:

<iframe / img / a>

It will make it easier afterwards to style the iframe or links so they won't overflow.

@julianlam
Copy link
Member

What do you mean by wrapped? I'm confused as to what you are suggesting 😄

@PostMidnight
Copy link
Author

My apology for not being coherent, please allow me to rephrase:

One of the ways to make iframe responsive (but not only iframes), is to wrap it with two divs. In the outer div one may set position=relative, and in the inner div one may set position=absolute. See here: https://blog.theodo.fr/2018/01/responsive-iframes-css-trick/

Although the article recommends a single div wrap, I found that double divs makes things easier especially if you wish to do further styling.

So <iframe src=...> becomes:

<div class="outer-container>
   <div class="inner-container>
       <iframe src=...
   </div>
</div>

Currently I am doing the above swap using filter:parse.post but I believe we should do this in the client with Quill, so as not to burden the server with this code.

Note also the oEmbed code snippet mentioned in the other git issue I opened today. It may be a good idea to integrate it all together as part of the client.

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

No branches or pull requests

2 participants