JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q37055F
  • License MIT

vue text filters, handle some code like wx-emotions/softbank-emoji/...

Package Exports

  • vue-text-filters

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (vue-text-filters) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

getting started

vue-text-filters 以Vue(1.0/2.0)插件的形式提供一系列处理html文本的filter

安装

npm install --save vue-text-filters

使用

import VueTextFilters from 'vue-text-filters'
Vue.use(VueTextFilters)
// 解析段落
{{{ text | emojiSoftbankToUnified | safeAllEntityEncode | sbEmotions | transLinebreak }}}

如果需要使用emojiUnifiedToHtml,需要单独引入css样式

import 'emoji/lib/emoji.css'

features

目前支持 'emoji', 'sbEmotions', 'htmlEntity', 'linebreak'
emoji https://www.npmjs.com/package/emoji
sbEmotions 是指square-bracket,类似[微笑] https://www.npmjs.com/package/wechat-square-bracket-emotions
htmlEntity 是指htmlEntity编解码
linebreak 是指将文本换行转换为html支持的

params

options

  • needs 一个Array,包含需要的filter(见features)名称