We Rich
Parse HTML into Weapp rich-text Nodes
HTML转小程序 rich-text 控件节点
Usage
Node
npm install we-rich const weRich = require('we-rich');var nodes = weRich.parse(html);
例子 Input/Output
hello world
"type": "node" "name": "div" "attrs": "class": "post post-featured" "children": "type": "node" "name": "p" "attrs": {} "children": "type": "text" "text": "hello" "type": "node" "name": "div" "attrs": {} "children": "type": "text" "text": "world" "type": "node" "name": "img" "attrs": "src": "test.png" "style": "max-width:100%" "children":
功能
HTML into 微信小程序rich-text使用的nodes
安装
npm install we-rich --save
const weRich = ;var nodes = weRich;