npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@openregion/tinymce-word-paste-plugin

v1.0.4

Published

TinyMCE plugin to paste from Word

Downloads

229

Readme

TinyMCE Word Paste Plugin

This plugin provides the capability to accept data from Microsoft Word, and clean-up the received data before pasting it into place.

Tested on TinyMCE 6/7.

Based on TinyMCE 5.10.7 paste plugin.

Usage

Install package

npm install @openregion/tinymce-word-paste-plugin

Import plugin

import '@openregion/tinymce-word-paste-plugin';

Options

paste_enable_default_filters

This option allows you to disable TinyMCE's default paste filters when set to false.

Type: Boolean

Default Value: true

Possible Values: true, false

Example: Using paste_enable_default_filters

tinymce.init({
  selector: 'textarea',  // change this value according to your html
  plugins: 'pasteword',
  menubar: 'edit',
  paste_enable_default_filters: false
});

paste_word_valid_elements

This option enables you to configure the valid_elements specific to MS Office. Word produces a lot of junk HTML, so when users paste things from Word we do extra restrictive filtering on it to remove as much of this as possible. This option enables you to specify which elements and attributes you want to include when Word contents are intercepted.

Note: To access this feature, you need to set the value of paste_enable_default_filters to "false" in your configuration.

Type: String

Example: Using paste_word_valid_elements

tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  plugins: 'pasteword',
  menubar: 'edit',
  paste_word_valid_elements: 'b,strong,i,em,h1,h2'
});

paste_retain_style_properties

This option allows you to specify which styles you want to retain when pasting contents from MS Word and similar Office suite products. This option can be set to a space-separated list of CSS style names, or "all" if you want all styles to be retained.

Type: String

Example: Using paste_retain_style_properties

tinymce.init({
  selector: 'textarea',  // change this value according to your html
  plugins: 'pasteword',
  menubar: 'edit',
  paste_retain_style_properties: 'color font-size'
});

paste_convert_word_fake_lists

This option lets you disable the logic that converts list like paragraph structures into real semantic HTML lists.

Type: Boolean

Default Value: true

Possible Values: true, false

Example: Using paste_convert_word_fake_lists

tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  plugins: 'pasteword',
  menubar: 'edit',
  paste_convert_word_fake_lists: false
});