Skip to content

cleanHTML -> removeEmptyElements expectations #302

@Thyrannoizer

Description

@Thyrannoizer

Version: "jodit-react": "^5.2.6"

May i am wrong with the Interpretation of the cleanHTML config object but should the HTML tags below not be removed by this setting ? Or did I misunderstood the docs ?

config:

 const config = useMemo(
        () => ({
            readonly: false, // all options from https://xdsoft.net/jodit/docs/,
            language: 'de',
            defaultMode: 1,
            showCharsCounter: false,
            showWordsCounter: false,
            showXPathInStatusbar: false,
            askBeforePasteHTML: false,
            askBeforePasteFromWord: false,
            disablePlugins:
                'resizer,search,ai-assistant,class-span,xpath,about,fullsize,speech-recognize,source',
            inline: true,
            toolbarInlineForSelection: true,
            showPlaceholder: false,
            cleanHTML: {
                removeEmptyElements: true,
                fillEmptyParagraph: true,
            },
            wrapNodes: {
                emptyBlockAfterInit: false,
            },
        }),
        []
    );

so when you click just on a button on the toolbar without any user input, onBlur triggers with this new State for example:
<p><strong></strong><br></p>

I'am trying to achieve no Content instead, regardless what the user is Clicking. Only if there is an actual Input.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions