Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#10325 closed Bug (invalid)

Prevent removing empty anchors

Reported by: Roy Shoa Owned by:
Priority: Normal Milestone:
Component: General Version: 4.1
Keywords: Cc:

Description

Hi, As I understand the CKEditor is removing automatically an empty Anchors. The problem is that a lot of HTML addons are using empty anchors and they store them in JavaScript after the page is loaded.

e.g. If i like to use AddThis they let me add the next code:

<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_button_pinterest_pinit"></a>
<a class="addthis_counter addthis_pill_style"></a>
</div>

And after I change the display from source to design the CKEditor is removing all the Anchors.

I know that if I will add &nbsp; to the Anchors the CKEditor will not remove them but in my case I am a programmer. The problem is that we have thousands of customers that working on are Website CMS and we can not explain this problem to any customer for every addon he use.

Anyway I sow at list 3 ticket that open for this problem and CKEditor team is close them by saying that this is how CKEditor works.

Now i am saying that this is how CKEditor not need to continue working if CKEditor like to have a lot of customers. I do now understand what is the problem to add a property of IgnoreEmptyAnchors and if the programmer like he will turn it on and the problem will be fix.

This is a win win for the programmer and for the CKEditor.

Thanks.

Change History (2)

comment:1 Changed 7 years ago by Jakub Ś

Keywords: empty anchors removed
Resolution: invalid
Status: newclosed

This issue has been fixed in #10224. Your current problems concern two things ACF and empty inline tag.

For ACF. Please see:
http://ckeditor.com/blog/CKEditor-4.1-RC-Released
http://docs.ckeditor.com/#!/guide/dev_allowed_content_rules
http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-allowedContent
http://ckeditor.com/blog/Upgrading-to-CKEditor-4.1
If you don't need ACF please use config.allowedContent = true;

You can't have something like <a class="abc"></a> in editor (anchors are exception here). Such tag needs to have at least &nbsp; inside <a class="abc">&nbsp;</a>

comment:2 Changed 7 years ago by Piotrek Koszuliński

Yep, we're removing empty links because they cannot be edited. This isn't configurable because every option like this has to be covered by tests. In this case - tens of them in many places.

However, I see that you're trying to insert some kind of template that should not be editable. I advice you to convert it to placeholder when loading data and convert back to this template when getting it. You can use dataProcessor and its two filters - dataFilter and htmlFilter. Or reuse fakeobjects plugin.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy