Bug reports Found a bug? Post it here please.
Version 7.x > Bug reports > Anchor tags disappearing or misplacing while saving it in the Editable text View modes: 
User avatar
Member
Member
bismihbn-hotmail - 11/11/2013 6:44:14 AM
   
Anchor tags disappearing or misplacing while saving it in the Editable text
Hi,

We have a editable text in a page. While we are updating the content with anchor tags in it for eg. <a href="javascript:;">Link</a>. After clicking save button, the anchor tags are disappering from the content. We have did it in source code mode. Please suggest us.

User avatar
Kentico Support
Kentico Support
kentico_romank - 11/12/2013 8:19:11 AM
   
RE:Anchor tags disappearing or misplacing while saving it in the Editable text
Hi,

Could you please tell me what hotfix have you applied? So I can try to reproduce the behavior on the same hotfix version.

Also what exactly do you mean by "disappearing from the content"? When you place this <a href="javascript:;">Link</a> to source code mode, what will you get on live site?

Best Regards,
Roman Konicek

User avatar
Member
Member
bismihbn - 11/13/2013 5:46:09 AM
   
RE:Anchor tags disappearing or misplacing while saving it in the Editable text
I have applied 7.59 hotfix. Even in earlier hotfixes such as 7.34 issue remains same.

At first time I am getting the expected code as per in the source code i.e. Link. While I am trying to edit it again. I can't see such anchor tag for that text "Link". Only text "Link" appears. Not only for anchor tag, any empty tag is disappearing while we trying to edit second time.


User avatar
Kentico Support
Kentico Support
kentico_romank - 11/14/2013 3:29:47 AM
   
RE:Anchor tags disappearing or misplacing while saving it in the Editable text
Hi,

I have a problem to reproduce the issue. I have performed the following steps:

1. I have put some editable text web part on page
2. on Page tab I have switched into source mode and the insert <a href="javascript:;">Link</a> and save it
3. Then I refresh the page and switched into the source mode again and I can still see <a href="javascript:;">Link</a>

Am I missing something?

Best Regards,
Roman Konicek

User avatar
Member
Member
bismihbn - 11/26/2013 4:10:44 AM
   
RE:Anchor tags disappearing or misplacing while saving it in the Editable text
Hi,

Can you please try using empty <i></i> tag using the same steps. Try frequently updating in source view and Save and Close. We are still facing the same issue.

User avatar
Kentico Support
Kentico Support
kentico_romank - 12/9/2013 4:00:09 AM
   
RE:Anchor tags disappearing or misplacing while saving it in the Editable text
Hi,

So the problem is whenever you insert <i></i> to CKEditor in source mode, the empty tags are removed, is that correct? If yes, it is not a bug, but rather a default behavior of CKEditor, please see for example this article http://stackoverflow.com/questions/18250404/ckeditor-strips-i-tag

I hope this information helps.

Best Regards,
Roman Konicek

User avatar
Member
Member
bismihbn - 12/9/2013 6:42:47 AM
   
RE:Anchor tags disappearing or misplacing while saving it in the Editable text
yes you are correct Roman. Empty tags are removed. Actually css are based on some empty tags. That's why we are trying to do so.

User avatar
Kentico Support
Kentico Support
kentico_romank - 12/9/2013 7:00:10 AM
   
RE:Anchor tags disappearing or misplacing while saving it in the Editable text
Hi,

Did you try the suggestion in article I have posted in previous post? If you open visual studio and go to ~/CMSAdminControls/CKeditor/config.js and add the following lines:
config.protectedSource.push(/<i[\s\S]*?\>/g); //allows beginning <i> tag
config.protectedSource.push(/<\/i[\s\S]*?\>/g); //allows ending </i> tag
it should solve your problem, basically you can place there any tag you want by changing the "i" in the definiton.

Best Regards,
Roman Konicek