Webmark can render markdown content in an applet. It supports most markdown features such as pictures and tables.
Characteristic
- It is provided in the form of applet custom components and can be directly introduced for use
- Support the analysis and rendering of most markdown Tags
- Support code table, code highlighting, HTML video and other features
- Support for rendering with native rich text
- Compatible with mpvue and other development frameworks
Use
1. Download and copy the Webmark directory to the applet root directory
2. Reference the Webmark component in the configuration file of the page
{
"usingComponents": {
"wemark": "../wemark/wemark"
}
}
3. Used in wxml:
<wemark md="{{md}}" link highlight type="wemark"></wemark>
Parameter Description:
- MD, required, the markdown string to be rendered;
- Link, whether to parse the link. If it is parsed, it will be displayed using the applet navigator component. You can jump within the applet. The default value is false;
- Highlight: whether to highlight the code. The default value is false;
- Type, rendering mode. Webmark will use the data structure and template of Webmark for rendering, and rich text will use the rich text component built in the applet for rendering (link jump and video are not supported).
Operation effect
Other
Webmark project address: https://github.com/toobug/webmark