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
[GHS] HTML elements wrapped in <a>s are deleted #13803
Comments
I believe the following is the same issue:
✔️ Expected resultThe html stays the same. ❌ Actual resultThe html changes to the following, stripping the h2
|
Thanks @RaspberryBlack, added a new issue for this case: #14249. |
|
Using Also the more general solution is probably what I and Drupal actually need as well. In Drupal, we have a media embed tool that allows embedding complex media inside ckeditor. Using this the user might insert all sorts of complicated html depending on what the site developer implements. As an example, I have a site with an image embed that uses a Despite being a figure, that embed image feels like a normal image and because Drupal's widget integration they can generally interact with it like one. They want to just click the link tool and wrap it in a link. All our technology, browsers, styles, etc are setup to work with it wrapped as a link but because of this bug it doesn't work for them. They're frustrated because they can't "just link and image in ckeditor" |
Thanks @neclimdul for more context. The complexity we are facing is that CKEditor 4 has a totally different implementation than CKEditor 5 and different mechanisms of extensibility. CKE5 operates on the internal model and needs to know what to accept to it, and how to represent it in HTML. The model gives us a "pure" abstraction layer, a safer development, etc., in return for some cost of agility and freedom.
And this is also possible for CKE5 but inserting this complex HTML needs to be aligned with the way plugin development works. In fact, in most complex representations, you will not be inserting HTML but predefined models' elements, and conversion will handle the HTML output for editing and data view. That said, we are aware of the migration of content from CKEditor 4 (as well as advanced Drupal cases), and we need to prepare for some cases with special ways of handling them.
And actually, they can, as we have integration of As for other elements more research needs to be done on our side. |
As for the OP, I ran some additional tests, and in fact, the <div class="adblock">
<a href="/link">
<picture>
<source media="">
<img src="image">
</picture>
</a>
</div> on the GHS demo. The problem appears, due to the wrong usage of a
We store To be discussed how to approach a fix in the |
The fix most likely just requires two actions:
add in inline objects group for {
model: 'htmlPicture',
view: 'picture',
isObject: true,
modelSchema: {
inheritAllFrom: '$inlineObject'
}
}, Extend
this way we will handle elements that are not known to GHS. |
An important point to mention - we will support Examples below: Before <a href="https://ckeditor.com">
<div>CKEDITOR</div>
</a> After <div><a href="https://ckeditor.com">CKEDITOR</a></div> Before <a href="https://ckeditor.com">
<figure>
<blockquote cite="https://www.huxley.net/bnw/four.html">
<p>Words can be like X-rays, if you use them properly—they’ll go through anything. You read and you’re pierced.</p>
</blockquote>
<figcaption>—Aldous Huxley, <cite>Brave New World</cite></figcaption>
</figure>
</a> After <figure>
<blockquote cite="https://www.huxley.net/bnw/four.html">
<p><a href="https://ckeditor.com">Words can be like X-rays, if you use them properly—they’ll go through anything. You read and you’re pierced.</a></p>
</blockquote>
<figcaption><a href="https://ckeditor.com">—Aldous Huxley, <cite>Brave New World</cite></a></figcaption>
</figure> |
Fix (html-support): GHS should allow linking of custom elements. Closes #13803 .
🥳 Reported the progress at https://www.drupal.org/project/drupal/issues/3349893#comment-15113038 😊 |
📝 Provide detailed reproduction steps (if any)
Reported by Drupal community: https://www.drupal.org/project/drupal/issues/3349893
✔️ Expected result
There's no data loss.
❌ Actual result
The wrapping
<a>
is lost!If you'd like to see this fixed sooner, add a 👍 reaction to this post.
The text was updated successfully, but these errors were encountered: