-
Notifications
You must be signed in to change notification settings - Fork 395
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
Bug: Images inside links get moved outside the link on start #43
Comments
I think the issue here is that you need to mark the
As you want the |
Here's how I'm doing it. Initially, the content is this:
Afterwards, I start the editor then it moves it out. I think the image shouldn't be moved out of the link and it should be handled. What's happening with the image inside the link? I can't actually add images as of the moment. I tried it but nothing's happening, probably since I'm doing this in WordPress or that I'm not handling uploads yet. So I can't check the marked up html yet for images with a link. Prior to editing, I also tried adding |
So you'd need to change your initial content to:
By default The image shouldn't be moved outside the link, oddly when I add your code to the Can you test that this issue doesn't occur if you add the following code to the sandbox demo in the repo:
If you get the same issue then it might well be an issue with a specific browser I need to look at so could you provide details. |
Still the same thing. In the sandbox, I added this (this is from the inspector):
After clicking the edit, I'm getting this:
I'm using Chrome in Mac OS X 10.11 |
Ahhh... I understand now you're adding the image within an editable paragraph not as an editable image. You can't add images within paragraphs right now (well you can using HTML and they'll appear but you can't add them via the editor). That does however look like a bug in the the way that the HTMLString library is optimizing, clearly the image should be retained inside the |
Yup, you cannot add them, I'm totally fine with that. I'm modifying the HTML for editing them then performing the necessary CT functions so that the editor can see the changes like you mentioned. Thanks, hopefully we can fix it :) |
Yep - just tested the code in HTMLString Spec and it fails in the way you described, hopefully it's something easy :) |
@bfintal - OK I think that's resolved that. |
Wow that was fast. Thanks! Confirmed on my end 👍 |
Awesome (fortunately an easy fix) - sent you a question on Gitter re your early question :) |
If you have an image inside a link:
When you start editing the image gets moved outside the link and you can't get it back inside even when cancelling the edit:
The text was updated successfully, but these errors were encountered: