npm package: @mccool/tinymce-word-paste-filter
Description: Standalone filter for pasted MS Word HTML content; forked from TinyMCE
Author: Blake McCool
Latest version: 0.6.1
Deprecated: this package has been deprecated

## TinyMCE Word Paste Filter (standalone)

[![npm version](https://badge.fury.io/js/tinymce-word-paste-filter.svg)](https://badge.fury.io/js/tinymce-word-paste-filter) [![Build Status](https://travis-ci.org/jasonphillips/tinymce-word-paste-filter.svg?branch=master)](https://travis-ci.org/jasonphillips/tinymce-word-paste-filter) [![npm downloads](https://img.shields.io/npm/dm/tinymce-word-paste-filter.svg)](https://www.npmjs.com/package/tinymce-word-paste-filter)


### What?

This project provides a standalone version of the filter function used by TinyMCE to clean up pasted MS Word content. 

### Why?

TinyMCE has one of the best implementations of Word cleanup around; they have tackled pernicious problems like restoring list items to actual lists when these arrive as `<p>` tags with a lot of odd styles and bullet characters. However, TinyMCE is no tiny library, and does not export that capability by itself. 

This repo will remain an up-to-date fork of TinyMCE that builds only the Word Filter function (and its internal dependencies) into a standalone library much smaller (contributes [~50k](https://bundlephobia.com/result?p=tinymce-word-paste-filter@0.6.1) if you minify your build) than the full TinyMCE (contribrutes at minimum [>300k](https://bundlephobia.com/result?p=tinymce@4.7.5) to your project -- with the internal Word clean function not exposed), published on npm as `tinymce-word-paste-filter` for easy incorporation into other projects.

### How?

```js
import wordFilter from 'tinymce-word-paste-filter';

// if you have incoming pasted Word data in your program...
const awfulWordHTML = '...'; // content here

// clean it up in one step
const cleaned = wordFilter(awfulWordHTML); 
```

`grunt webpack:<name>-plugin`
Builds the demo js files for the specific plugin.

`grunt webpack:<name>-theme`
Builds the demo js files for the specific theme.

`grunt --help`
Displays the various build tasks.

Bundle themes and plugins into a single file
---------------------------------------------
`grunt bundle --themes=silver --plugins=table,paste`

Minifies the core, adds the silver theme and adds the table and paste plugin into tinymce.min.js.

Contributing to the TinyMCE project
------------------------------------
TinyMCE is an open source software project and we encourage developers to contribute patches and code to be included in the main package of TinyMCE.

__Basic Rules__

* Contributed code will be licensed under the LGPL license but not limited to LGPL
* Copyright notices will be changed to Ephox Corporation, contributors will get credit for their work
* All third party code will be reviewed, tested and possibly modified before being released
* All contributors will have to have signed the Contributor License Agreement

These basic rules ensures that the contributed code remains open source and under the LGPL license.

Please note that this is intended to be bundled into browser applications; if running in a node environment for some reason, you'll need to have browser / dom globals (document, navigator, etc) available.

See the brief test under `./standalone/test/` and its fixtures.

### Installation

The easiest way to use tinymce-word-paste-filter is to install it from npm and include it in your own React build process (using [Browserify](http://browserify.org), [Webpack](http://webpack.github.io/), etc).

```shell
npm install tinymce-word-paste-filter --save
```

### Building from source, testing

```shell
npm install
npm run build
npm run test
```