├── .gitignore ├── LICENSE ├── README.md ├── app.js ├── app.json ├── app.wxss ├── config.js ├── image ├── icon_API.png └── icon_API_HL.png ├── package.json ├── pages ├── index │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss └── lab │ ├── lab.js │ ├── lab.json │ ├── lab.wxml │ └── lab.wxss ├── screenshoot ├── screen.jpg ├── weappmsg_qr.jpg ├── wxParse-flow.jpg └── wxParse_logo.jpg ├── utils ├── api.js └── util.js └── wxParse ├── emojis ├── 00.gif ├── 01.gif ├── 02.gif ├── 03.gif ├── 04.gif ├── 05.gif ├── 06.gif ├── 07.gif ├── 08.gif ├── 09.gif ├── 10.gif ├── 100.gif ├── 101.gif ├── 102.gif ├── 103.gif ├── 104.gif ├── 105.gif ├── 106.gif ├── 107.gif ├── 108.gif ├── 109.gif ├── 11.gif ├── 110.gif ├── 111.gif ├── 112.gif ├── 113.gif ├── 114.gif ├── 115.gif ├── 116.gif ├── 117.gif ├── 118.gif ├── 119.gif ├── 12.gif ├── 120.gif ├── 121.gif ├── 122.gif ├── 123.gif ├── 124.gif ├── 125.gif ├── 126.gif ├── 127.gif ├── 128.gif ├── 129.gif ├── 13.gif ├── 130.gif ├── 131.gif ├── 132.gif ├── 133.gif ├── 134.gif ├── 14.gif ├── 15.gif ├── 16.gif ├── 17.gif ├── 18.gif ├── 19.gif ├── 20.gif ├── 21.gif ├── 22.gif ├── 23.gif ├── 24.gif ├── 25.gif ├── 26.gif ├── 27.gif ├── 28.gif ├── 29.gif ├── 30.gif ├── 31.gif ├── 32.gif ├── 33.gif ├── 34.gif ├── 35.gif ├── 36.gif ├── 37.gif ├── 38.gif ├── 39.gif ├── 40.gif ├── 41.gif ├── 42.gif ├── 43.gif ├── 44.gif ├── 45.gif ├── 46.gif ├── 47.gif ├── 48.gif ├── 49.gif ├── 50.gif ├── 51.gif ├── 52.gif ├── 53.gif ├── 54.gif ├── 55.gif ├── 56.gif ├── 57.gif ├── 58.gif ├── 59.gif ├── 60.gif ├── 61.gif ├── 62.gif ├── 63.gif ├── 64.gif ├── 65.gif ├── 66.gif ├── 67.gif ├── 68.gif ├── 69.gif ├── 70.gif ├── 71.gif ├── 72.gif ├── 73.gif ├── 74.gif ├── 75.gif ├── 76.gif ├── 77.gif ├── 78.gif ├── 79.gif ├── 80.gif ├── 81.gif ├── 82.gif ├── 83.gif ├── 84.gif ├── 85.gif ├── 86.gif ├── 87.gif ├── 88.gif ├── 89.gif ├── 90.gif ├── 91.gif ├── 92.gif ├── 93.gif ├── 94.gif ├── 95.gif ├── 96.gif ├── 97.gif ├── 98.gif └── 99.gif ├── html2json.js ├── htmlparser.js ├── showdown.js ├── wxDiscode.js ├── wxParse.js ├── wxParse.wxml └── wxParse.wxss /.gitignore: -------------------------------------------------------------------------------- 1 | # kdiff3 ignore 2 | *.orig 3 | 4 | # maven ignore 5 | target/ 6 | 7 | # eclipse ignore 8 | .settings/ 9 | .project 10 | .classpath 11 | 12 | # idea ignore 13 | .idea/ 14 | *.ipr 15 | *.iml 16 | *.iws 17 | 18 | # temp ignore 19 | *.log 20 | *.cache 21 | *.diff 22 | *.patch 23 | *.tmp 24 | 25 | # system ignore 26 | .DS_Store 27 | Thumbs.db 28 | 29 | # package ignore (optional) 30 | # *.jar 31 | # *.war 32 | # *.zip 33 | # *.tar 34 | # *.tar.gz 35 | 36 | # nodejs ignore 37 | node_modules/ 38 | .vscode/ 39 | jsconfig.json 40 | typings/ 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Di 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

抱歉各位,本项目已经停止维护,为了不给您使用造成问题,请仅做参考使用,感谢各位支持

2 | 3 | 4 |

5 |

6 |

wxParse-微信小程序富文本解析组件

7 |

支持Html及markdown转wxml可视化

8 |

版本号:0.3

9 |

来源: [微信小程序开发论坛-weappdev](https://weappdev.com)

10 |

作用: 将Html/Markdown转换为微信小程序的可视化方案

11 | 12 | 13 | ## 特性 14 | 15 | 16 | | 支持特性 | 实验功能 | ToDo | 17 | | ------------- |-------------| -----| 18 | | - [x] HTML的大部分标签解析 | [x] 小表情emjio | [x] table标签 | 19 | | - [x] 内联style | [x] a标签跳转 | | 20 | | - [x] 标签Class | [x] 动态添加 | | 21 | | - [x] 图片自适应规则 | | | 22 | | - [x] 图片多图片预览 | | | 23 | | - [x] 模版层级可扩展性 | | | 24 | | - [x] 多数据循环方式 | | | 25 | | - [x] 内联style | | | 26 | | | | | 27 | 28 | ## 相关截图 29 | 30 | ![相关截图](screenshoot/screen.jpg) 31 | 32 | ## 感谢 33 | 34 | [@stonewen](https://github.com/stonewen)| [@Daissmentii](https://github.com/Daissmentii) | [@wuyanwen](https://github.com/wuyanwen) | [@vcxiaohan](https://github.com/vcxiaohan) | 35 | 36 | ## 基本使用方法 37 | 38 | * 1. Copy文件夹`wxParse` 39 | ``` 40 | - wxParse/ 41 | -wxParse.js(必须存在) 42 | -html2json.js(必须存在) 43 | -htmlparser.js(必须存在) 44 | -showdown.js(必须存在) 45 | -wxDiscode.js(必须存在) 46 | -wxParse.wxml(必须存在) 47 | -wxParse.wxss(必须存在) 48 | -emojis(可选) 49 | ``` 50 | 51 | * 2. 引入必要文件 52 | 53 | ``` 54 | //在使用的View中引入WxParse模块 55 | var WxParse = require('../../wxParse/wxParse.js'); 56 | ``` 57 | 58 | ``` 59 | //在使用的Wxss中引入WxParse.css,可以在app.wxss 60 | @import "/wxParse/wxParse.wxss"; 61 | ``` 62 | 63 | * 3. 数据绑定 64 | ``` 65 | var article = '
我是HTML代码
'; 66 | /** 67 | * WxParse.wxParse(bindName , type, data, target,imagePadding) 68 | * 1.bindName绑定的数据名(必填) 69 | * 2.type可以为html或者md(必填) 70 | * 3.data为传入的具体数据(必填) 71 | * 4.target为Page对象,一般为this(必填) 72 | * 5.imagePadding为当图片自适应是左右的单一padding(默认为0,可选) 73 | */ 74 | var that = this; 75 | WxParse.wxParse('article', 'html', article, that, 5); 76 | ``` 77 | 78 | * 4. 模版引用 79 | ``` 80 | // 引入模板 81 | 82 | //这里data中article为bindName 83 |