当前位置:网站首页>Baidu applet rich text parsing tool bdparse
Baidu applet rich text parsing tool bdparse
2022-06-26 09:03:00 【CMS applet plug-in [official]】
Recently doing Baidu applet , It is found that Baidu applet is rarely contacted at present , I can't find the relevant technical support , In particular, rich text processing tools for handling articles . Anyone who has done a wechat applet knows , Wechat has a wxParse, A set of components specially developed for wechat rich text , Can make html A node that is converted into an applet , So I wondered if I could wxParse Transformed into Baidu applet .
Because the code similarity between Baidu applet and wechat applet is larger 95% above , Almost wechat wxml,js Request and label batch replacement with Baidu swan,js Of ,css and json Completely universal , This also includes rich text nodes exactly the same , So try to transform , The cycle used for Baidu and wechat is different from the template call , So it took some time , In order to distinguish between wxParse, So change your name bdParse.
bdParse Project download address :https://gitee.com/sootou/bdparse
Project introduction
Baidu applet rich text parsing tool bdParse, Remodel from wxparse, Support html Convert to Baidu applet rich text node .
Installation tutorial
- Download the entire file , Put it in your applet root directory
- On the applet page js Direct introduction of code :
var bdParse = require('../../bdParse/bdParse.js'); Corresponding css Introduction in@import "../../bdParse/bdParse.css"; - Use... In the required fields baparse, Code :( Be careful :article and content Don't repeat )
that.setData({ content:bdParse.bdParse('article', 'html', content, that, 5), }) - swan Page import template ,
<import src="../../bdParse/bdParse.swan" />Then call... Where you need to display rich text :<template is="bdParse" data="{ { {bdParseData:article.nodes} }}" />( Be careful :data The call is changed to and wxParse Consistent writing , Notice the three braces , The original direct writing { {article}} No longer supported , Please pay attention to the modification )
Instructions
- swan Calling the template data="{ { {bdParseData:article.nodes} }}" and setData Medium article bring into correspondence with .
- call bdparse Component time , The component has assigned the rich text content ( namely setData) Give it to article;{ { {bdParseData:article.nodes} }} This way of writing means : hold article.nodes The content of is assigned to bdParseData,bdParse.swan What is called is bdParseData.
Other instructions
- bdParse Is in wxParse On the basis of , Just put wxParse Replace with bdParse, contain js,swan, css
- wxml Change the suffix to swan, In addition, the calling method of all template value transfer has been modified , Conform to the use of Baidu applet .
- Fixed proprietary components of other Baidu applets , such as s-for,s-if,s-elif,s-for-index wait
- Fix other problems , For example, remove
<template name="wxParseImg">Repetitive mode, To all s-for-index add to idx( It seems that it cannot be empty ). - Other modifications , I won't repeat
- Because the content is replaced directly in batches , Basic articles can meet the needs of , Others have not done much testing , Welcome your feedback bug
Participation and contribution
- developer : Jianteng stone station
- Official website :http://www.tengcee.com
- bdParse.swan Remodel from wxParse.wxml
- wxParse The original author github Address : https://github.com/icindy/wxParse
It's not easy , Support a lot
If you think bdParse Helped you solve the problem , Please don't forget to reward , Your support is our biggest motivation .

边栏推荐
- Exploration of webots and ROS joint simulation (II): model import
- [IVI] 15.1.2 system stability optimization (lmkd Ⅱ) psi pressure stall information
- Sublime Text3 common plug-ins
- Fast construction of neural network
- 修复小程序富文本组件不支持video视频封面、autoplay、controls等属性问题
- 20220623 Adobe Illustrator入门
- 2021 software university ranking crawler program
- PD快充磁吸移動電源方案
- 微信小程序如何转换成百度小程序
- yolov5进阶之零环境快速创建及测试
猜你喜欢

Slider verification - personal test (JD)

外部排序和大小堆相关知识

Construction and verification of mongodb sharding environment (redis final assignment)

Yolov5进阶之五GPU环境搭建

【程序的编译和预处理】

Yolov5进阶之一摄像头实时采集识别

【300+精选大厂面试题持续分享】大数据运维尖刀面试题专栏(一)

【MATLAB GUI】 键盘回调中按键识别符查找表

深度学习论文阅读目标检测篇(七)中文版:YOLOv4《Optimal Speed and Accuracy of Object Detection》

The solution of positioning failure caused by framework jump
随机推荐
拦截器与过滤器的实现代码
Construction and verification of mongodb sharding environment (redis final assignment)
Speckle denoising method for ultrasonic image
PD快充磁吸移動電源方案
Stanford doggo source code study
QT_ AI
Simulation of parallel structure using webots
phpcms v9商城模块(修复自带支付宝接口bug)
如何利用最少的钱,快速打开淘宝流量入口?
Detailed process of generating URDF file from SW model
Drawing with MATLAB (2) -- color ring
MySQL在服务里找不到(未卸载)
Yolov5 advanced camera real-time acquisition and recognition
[qnx hypervisor 2.2 user manual]12.2 terminology (II)
Object extraction_ nanyangjx
phpcms手机站模块实现自定义伪静态设置
torch. fft
[QNX Hypervisor 2.2用户手册]12.2 术语(二)
【IVI】15.1.2 系统稳定性优化篇(LMKD Ⅱ)PSI 压力失速信息
HDU - 6225 little boxes (\u int128)