-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
You shouldn't be able to link an image (just yet) #4771
Comments
To clarify why images can't be linked yet – the problem here is that so far we support linking text, so we can convert text attribute to a With images we need to convert an element attribute to an <figure class="image">
<a href="..."><img src="..." alt="..."></a>
<figcaption>Caption.</figcaption>
</figure> The model would look like this: <image linkHref="..." src="..." alt="...">
<caption>Caption.</caption>
</image> |
Fix: Linking an entire image should not be possible. Closes #85.
Please see the discussion in ckeditor/ckeditor5-link#132 (comment). The quick fix was too brutal. A slightly better fix would be to change this behaviour in So, we need to figure out the right solution and as this issues is not annoying or something (the editor doesn't blow up) this can be postponed. I guess that at some point we'll simply implement the ability to link images. |
I wonder if the issue may re–appear in other features (also in the future). Essentially the case is that some inline attribute can be applied in such situation
but cannot be applied to the
It might be a very common case in different kind of widgets, e.g. if we ever decided blockquote should be one, etc.. We might need to figure out the solution anyway then. |
I'm not sure what you mean. The other cases which I mentioned are bold and italic. They are a slightly different case than link, but the effect is identical – if you apply bold to a selected image that bold applies in the caption. While it's hard to tell whether this makes sense with an image, that would certainly be the expected result if blockquote was some kind of widget. The editor will work in these cases as long as schema is well defined. However, it's a UX question whether people want to apply inline styles to block widgets at all. And which of these inline styles should rather apply to the whole element (like we want the link to do). |
I'm not sure why we kept this issue open. The only one which makes sense now is: #702 (allow linking images). |
<script src="https://cdn.ckeditor.com/ckeditor5/34.2.0/classic/ckeditor.js"></script>
i m using this version and not able to use linkingImage facility I mean i cant able to add link over Image |
The link feature should be disabled when an image is selected. Most likely some state check is missing.
In the future, we'll add the possibility to link images, but so far we don't have converters for that.
Alternatively, instead of fixing the state check now, we can add a converter allowing linking images. But the state check needs to be fixed at some point anyway.
The text was updated successfully, but these errors were encountered: