0.5.2 • Published 2 years ago

@prezly/docx-cleaner v0.5.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@prezly/docx-cleaner

Normalize dirty HTML and DOCX/RTF documents into clean, understandable HTML

Version License

Usage

import React, { ClipboardEvent, useState } from 'react';
import { cleanDocx } from '@prezly/docx-cleaner';

const MyComponent = () => {
    const [value, setValue] = useState<string>('');

    function handlePaste(event: ClipboardEvent<HTMLTextAreaElement>) {
        const html = event.clipboardData.getData('text/html');
        const rtf = event.clipboardData.getData('text/rtf');

        try {
            const cleanHtml = cleanDocx(html, rtf);
            setValue(cleanHtml);
        } catch (error) {
            setValue(error.message);
            console.error(error);
        }
    };

    return <textarea value={value} onPaste={handlePaste} />;
};

export default MyComponent;

Development

In order to start developing, run the build in watch mode.

Setup

npm install           # install dependencies
npm run build:watch   # start watcher

Publishing

npm run release     # reinstall & rebuild everything from scratch and...
                    # ...and run a wizard that'll guide you through publishing the npm package

Brought to you by Prezly.

0.5.2

2 years ago

0.5.0

4 years ago

0.5.1

4 years ago

0.3.0

4 years ago

0.4.0

4 years ago

0.2.2

4 years ago

0.2.0-alpha.0

4 years ago

0.2.0-alpha.2

4 years ago

0.2.0-alpha.1

4 years ago

0.2.0-alpha.3

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0-alpha.40

4 years ago

0.1.0-alpha.32

4 years ago

0.1.0-alpha.31

4 years ago

0.1.0-alpha.34

4 years ago

0.1.0-alpha.33

4 years ago

0.1.0-alpha.36

4 years ago

0.1.0-alpha.35

4 years ago

0.1.0-alpha.38

4 years ago

0.1.0-alpha.37

4 years ago

0.1.0-alpha.39

4 years ago

0.1.0

4 years ago

0.1.0-alpha.30

4 years ago

0.1.0-alpha.29

4 years ago

0.1.0-alpha.28

4 years ago

0.1.0-alpha.27

4 years ago

0.1.0-alpha.26

4 years ago

0.1.0-alpha.23

4 years ago

0.1.0-alpha.25

4 years ago

0.1.0-alpha.24

4 years ago

0.1.0-alpha.22

4 years ago

0.1.0-alpha.21

4 years ago