I found this bug in Sitecore content editor the other day – in the Rich Text Editor, if you are editing an HTML and want to edit a link to point to a Sitecore Link, it will wipe out any existing css classes on your link.

So, something like this:

<a href="http://mylink" class="test">This is the Text</a>

Will become like this:

<a href="http://mynewlink">This is the Text</a>

I figured that the custom command that edits this is not saving any other attributes of the link – the command is in \sitecore\shell\Controls\Rich Text Editor\RichText Commands.js ; I opened a support ticket and Sitecore Support managed to fix this for me pretty quickly. It has been registered as a bug, and the fix is available here:

https://github.com/SitecoreSupport/Sitecore.Support.95393.165781/releases/tag/9.0.1.0

Note: This has been tested in Sitecore 9 update 1