The rich text parsing custom component of the applet, which supports HTML and markdown parsing, may be the first rich text parsing component of the applet.
WxParse
The rich text parsing custom component of the applet, which supports HTML and markdown parsing, may be the first rich text parsing component of the applet.
I hope you can find the problem, submit the problem, or submit your modified code by using foke.
Composition
-WxParse -- wxParse. js (tool Portal output port) -- wxParse. wxml (Template File) -- wxParse. wxss (defines css)
Usage
Copy the entire folderwxParse/
To the root directory
Apply a style filewxParse.wxss
Introduced to the scope of your calls to this plug-in.
@ Import "your path/wxParse. wxss ";
In the templatex.wxml
Introducing template fileswxParse.wxml
IntroducewxParse.js
File
Var WxParse = require ('Your path/wxParse. js ');
Set the corresponding data value arraywxParseData
(WxParseData must be used) and
// Html parsing onLoad: function () {console. log ('onload') var html ='WxParse-small program rich text parsing custom component, supports HTML and markdown parsing
Custom components for rich text parsing in applets, supporting HTML and markdown parsing
Function List
- Dynamic code loading
- Convert html to json
- Markdown to convert html to json
- Rich text markdown analysis
- Custom level resolution
- Custom style sheets
File function
// WxParse. wxml // template used for parsing. css {text-align: center ;}Test p
Development Information
Applet Development Forum
! [] (Http://img.php.cn/upload/article/000/001/505/115945f096a6bba61f58be0b164de67b-1.png)
Applet logo
'; Var that = this // update the data that. setData ({wxParseData: WxParse ('html', html )})}
// Markdown parse onLoad: function () {console. log ('onload') var text = '# wxParse-small program rich text parsing custom component, support HTML and markdown parsing \ n' + '> small program rich text parsing custom components, support HTML and markdown parsing \ n \ n' + '# function list \ n * dynamic loading code \ n * html to json \ n * markdown to html to json \ n * rich text markdown parsing \ n * Custom level parsing \ n * custom style sheet \ n' + '# File function \ n' +' "// wxParse. wxml // template used for parsing "\ n' + '# Development Information \ n' +' [applet Development Forum] (http://weappdev.com) \ n' + '! [Applet logo] (http://img.php.cn/upload/article/000/001/505/115945f096a6bba61f58be0b164de67b-1.png) '; var that = this // update data that. setData ({wxParseData: WxParse ('MD', text )})}
Function List
TODO
Third-party reference
The above is the detailed content of wxParse Alpha0.1 which supports HTML and markdown parsing in the rich text of mini programs. For more information, see other related articles in the first PHP community!