A JS tool intended to be used as userscript to clean up HTML in a rich text editor in the browser
- Removes all style attributes from elements and all other unwanted attributes
- Replaces non breaking spaces with normal spaces
- Normalizes some custom Word and LibreOffice Writer formattings (e.g. for unordered lists) to proper HTML
- Currently only works with the TYPO3 rich text editor.
- All lists copied from a Microsoft Office product will be transformed to an unordered list.
- Nested lists from Microsoft Office products will be flattened to one level on insertion
- Install the Tampermonkey extension
- Click on the Tampermonkey extension icon on the right of the browser address bar, then on Dashboard.
- Click on the script icon with the green plus sign to create a new script.
- Paste the contents from bundle.js into the script editor, replacing all previous contents.
- Hit the save button
To update the userscript, follow step 2, then click on the edit icon with the pencil replace the old script with bundle.js.
Coming soon
Just copy the desired content into the rich text editor as you would normally do. The script automatically detects if the clipboard contains HTML content and transparently performs the cleaup in these cases. No special interaction by the user such as keyboard shortcuts are required.
A notification in form of a green circle in the bottom right corner of the viewport will appear as soon as the cleanup is performed, see screenshot:
Modern browsers such as Chrome 55+ and Firefox 51+. Other browsers may work too, but are untested.
- Clone this repository
- Run
npm install
in this directory - Run
npm run build
to generate the script bundle (bundle.js) from the source or alternativelynpm run watch
to incrementally build it on every change.