Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

quill-paste-smart

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

quill-paste-smart - npm Package Compare versions

Comparing version 1.3.1 to 1.4.0

2

package.json
{
"name": "quill-paste-smart",
"version": "1.3.1",
"version": "1.4.0",
"description": "Quill Extension to paste only supported HTML",

@@ -5,0 +5,0 @@ "main": "dist/quill-paste-smart.js",

@@ -62,3 +62,9 @@ # Quill Paste Smart

keepSelection: true,
substituteBlockElements: true,
magicPasteLinks: true,
hooks: {
uponSanitizeElement(node, data, config) {
console.log(node);
},
},
},

@@ -70,2 +76,6 @@ },

> :raised_hand: You don't need a custom configuration.
> You could stick with the default settings by completely omit the `clipboard` object in your quill options.
#### Configuration Object

@@ -77,4 +87,6 @@

| allowed.attributes | HTML attributes | `undefined` | `Array<string>` | Here you can define any HTML attributes that should be allowed to be pasted. If this setting is not specified, allowed attributes are determined by possible formats in the toolbar |
| substituteBlockElements | `true` `false` | `true` | `Boolean` | If this setting is set to `true` all forbidden block type tags will be substituted by one of the allowed tags `p`/`div`/`section` |
| keepSelection | `true` `false` | `false` | `Boolean` | If this setting is set to `true` the pasted content will be selected after pasting it. Otherwise the cursor will be placed right after the pasted content |
| magicPasteLinks | `true` `false` | `false` | `Boolean` | If this setting is set to `true` pasted links over selected text will be converted to an `a` tag. Example: If you select the word `foo` and paste the link `https://foo.bar/` the result will be `<a href="https://foo.bar/">foo</a>`. Note: This only works if there is nothing pasted except a valid link. |
| hooks | [DOMPurify Hooks](https://github.com/cure53/DOMPurify#hooks) | `undefined` | `Array<function>` | Here you can define any of the DOMPurify hooks. This can be handy if you need to cusomtize the HTML sanitizer. For more information see the [hook demos](https://github.com/cure53/DOMPurify/tree/main/demos) from DOMPurify.<br>**BE AWARE**<br>Here you can mess up things. E.g. You could create an infinite loop by adding not allowed tags to the node. |

@@ -81,0 +93,0 @@ <br>

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc