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

vue-3-sanitize

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-3-sanitize

HTML sanitizer for Vue.js 3 apps

  • 0.1.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

vue-3-sanitize

HTML sanitizer for Vue.js 3 apps.

vue-next npm

You want to use v-html? You might need to sanitize the code. This plugin is built for Vue 3 apps. It is built upon on sanitize-html.

Install

yarn add vue-3-sanitize
# or
npm install --save vue-3-sanitize

Usage

Registration

Register the plugin

import Vue3Sanitize from "vue-3-sanitize";

// const app = createApp(YourVue3App);
app.use(Vue3Sanitize);

To override the default options of sanitize-html, pass them as an argument. It is not supported to merge them.

const overridenOptions = {
    allowedTags: ['img']
};
app.use(Vue3Sanitize, overridenOptions);

Template

<template>
  <p v-html="$sanitize(dirty)" />
</template>

Issues

If you find any bugs, please open an issue.

Contributing

  1. Fork it
  2. Create your feature branch: git checkout -b feature-or-bugfix
  3. Add your changes: git add files
  4. Commit your changes: git commit -m "Add some feature"
  5. Push to the branch: git push origin feature-or-bugfix
  6. Submit a forked pull request

License

See License File.

Keywords

FAQs

Package last updated on 23 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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