当前位置:网站首页>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 .

边栏推荐
- 1.27 pytorch learning
- Srv6---is-is extension
- phpcms v9后台文章列表增加一键推送到百度功能
- Speckle denoising method for ultrasonic image
- 【MATLAB GUI】 键盘回调中按键识别符查找表
- Playing card image segmentation
- Construction and verification of mongodb sharding environment (redis final assignment)
- SRv6----IS-IS扩展
- OpenGL display mat image
- Notes on setting qccheckbox style
猜你喜欢

Graduation thesis management system based on SSM

Srv6---is-is extension

pgsql_ UDF01_ jx

Clion installation + MinGW configuration + opencv installation

设置QCheckbox 样式的注意事项

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

Install Anaconda + NVIDIA graphics card driver + pytorch under win10_ gpu

dedecms小程序插件正式上线,一键安装无需任何php或sql基础

ThreadLocal

phpcms v9后台文章列表增加一键推送到百度功能
随机推荐
OpenGL display mat image
Yolov5进阶之四训练自己的数据集
[QNX Hypervisor 2.2用户手册]12.2 术语(二)
Object extraction_ nanyangjx
攔截器與過濾器的實現代碼
读书笔记:SQL 查询中的SQL*Plus 替换变量(DEFINE变量)和参数
自动化测试中,三种常用的等待方式,强制式(sleep) 、 隐式 ( implicitly_wait ) 、显式(expected_conditions)
Regular Expression 正则表达式
Notes on setting qccheckbox style
cookie session 和 token
How to use leetcode
Which software is safer to open an account on
1.27 pytorch learning
Uniapp uses uparse to parse the content of the background rich text editor and modify the uparse style
Srv6---is-is extension
The solution of positioning failure caused by framework jump
Graduation thesis management system based on SSM
Pytorch build progression
Leetcode notes: binary search simple advanced
Construction and verification of mongodb sharding environment (redis final assignment)