1.0.2 • Published 6 years ago

rich-text-parser v1.0.2

Weekly downloads
20
License
ISC
Repository
github
Last release
6 years ago

在项目中使用该rich-text-parser

安装

$ npm i rich-text-parser -S --production

使用

  <rich-text nodes="{{nodes}}"></rich-text>
  import parser from 'rich-text-parser'

  parser.definedCustomTag({figure: 'p', figcaption: ''})
  const nodes = parser.getRichTextJson(html)

Api

参数说明参数参数类型返回值类型
getRichTextJson解析htmlhtmlStringObject
definedCustomTag定义需要解析的特殊标签,value不填默认是divoptionsObject-