0.5.2 • Published 1 year ago

@prezly/docx-cleaner v0.5.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year 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

1 year ago

0.5.0

2 years ago

0.5.1

2 years ago

0.3.0

3 years ago

0.4.0

3 years ago

0.2.2

3 years ago

0.2.0-alpha.0

3 years ago

0.2.0-alpha.2

3 years ago

0.2.0-alpha.1

3 years ago

0.2.0-alpha.3

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0-alpha.40

3 years ago

0.1.0-alpha.32

3 years ago

0.1.0-alpha.31

3 years ago

0.1.0-alpha.34

3 years ago

0.1.0-alpha.33

3 years ago

0.1.0-alpha.36

3 years ago

0.1.0-alpha.35

3 years ago

0.1.0-alpha.38

3 years ago

0.1.0-alpha.37

3 years ago

0.1.0-alpha.39

3 years ago

0.1.0

3 years ago

0.1.0-alpha.30

3 years ago

0.1.0-alpha.29

3 years ago

0.1.0-alpha.28

3 years ago

0.1.0-alpha.27

3 years ago

0.1.0-alpha.26

3 years ago

0.1.0-alpha.23

3 years ago

0.1.0-alpha.25

3 years ago

0.1.0-alpha.24

3 years ago

0.1.0-alpha.22

3 years ago

0.1.0-alpha.21

3 years ago