/octoparse2

基于 rich-text 的 html parse 解析,支持 微信/百度/支付宝/头条 小程序

Primary LanguageJavaScriptMIT LicenseMIT

octoparse2

基于 rich-text 的跨平台富文本解析

如何使用

// index.wxml
<rich-text nodes="{{nodes}}"></rich-text>
// index.js
const octoparse = require('octoparse2');

let richText = `<p style="text-align:center;">Hello World!</p>`;
let html = octoparse.parse(richText);

this.setData({
  nodes: html
});

Tips: 记得使用 构建npm,不然加载不了 node_modules 目录下的文件 参考文档