Friday, 1 October 2021

Remove tags when RemoveFormat is executed

I'm trying to extend RemoveFormat command to make it remove <br> tags.

I've tried altering removefromat format:

            formats: {
                removeformat: [
                    {
                        selector: 'br',
                        remove: 'all'
                    }
                ]
            }

The code above for some reason removes &nbsp; from blank lines <p>&nbsp;</p>, this is not acceptable.

My second try was adding plugin and using editor.selection.getContent/editor.selection.setContent, but I can not find information how to restore selection with this approach.



from Remove
tags when RemoveFormat is executed

No comments:

Post a Comment