'How to disable or remove filler in CKEditor 5?

Im currently using ckeditor 5 and it seems that every span that I add it always add <br data-cke-filler="true"> and &nbsp;. I found out that this module engine/view/filler (BR_FILLER() and NBSP_FILLER()) cause of this unexpected behavior. Is it possible to disable this module?

sample html:

           <p>
            <comment id="thread-1" type="start"></comment>
               <span style="color:hsl(0,0%,0%);">The</span>
            <comment id="thread-1" type="end"></comment>
            <span id="thread-2" type="start"></span>
               <span style="color:hsl(0,0%,0%);">quick</span></span>
            <span id="thread-2" type="end"></span>
            brown fox
        </p>

result:

enter image description here



Solution 1:[1]

var x= "some string";

x.replace(/<br data-cke-filler="true">/g, "&nbsp;");

is working for me.

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