'Django ckeditor is removing space around <a> tags

I'm using django-ckeditor with this config:

        'enterMode': 2, 
        'forceEnterMode': 'true',
        'basicEntities': 'false',
        
        'fillEmptyBlocks': 'false',
        'tabSpaces': 0,
        'entities': 'false',

When the original text look like this:

word1 <a>word2</a> word3

The final result after saving looks like this:

word1<a>word2</a>word3

I tried almost all possibilities when it comes to basicEntities, fillEmptyBlocks, tabSpaces and other configurations, but no way, ckeditor is always removing spaces around tags.

After several trials, I stopped searching for a solution. Your help will be appreciated.



Solution 1:[1]

According to this ckeditor github commit, this problem was fixed in July 2021. If you are using an older version of ckeditor, you would still see the problem.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 evergreen