{"id":15026625,"url":"https://github.com/icindy/wxparse","last_synced_at":"2025-05-14T07:08:23.025Z","repository":{"id":12362018,"uuid":"71701257","full_name":"icindy/wxParse","owner":"icindy","description":"wxParse-微信小程序富文本解析自定义组件，支持HTML及markdown解析","archived":false,"fork":false,"pushed_at":"2020-03-19T03:14:29.000Z","size":4734,"stargazers_count":7769,"open_issues_count":218,"forks_count":1815,"subscribers_count":263,"default_branch":"master","last_synced_at":"2025-04-11T02:51:26.465Z","etag":null,"topics":["html","markdown","weapp","weixin","wxparse-html-markdown"],"latest_commit_sha":null,"homepage":"http://weappdev.com/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/icindy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-23T12:25:18.000Z","updated_at":"2025-04-03T10:22:19.000Z","dependencies_parsed_at":"2022-07-15T11:30:30.753Z","dependency_job_id":null,"html_url":"https://github.com/icindy/wxParse","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icindy%2FwxParse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icindy%2FwxParse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icindy%2FwxParse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icindy%2FwxParse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/icindy","download_url":"https://codeload.github.com/icindy/wxParse/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254092775,"owners_count":22013290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["html","markdown","weapp","weixin","wxparse-html-markdown"],"created_at":"2024-09-24T20:04:47.848Z","updated_at":"2025-05-14T07:08:22.999Z","avatar_url":"https://github.com/icindy.png","language":"JavaScript","readme":"\u003ch1\u003e抱歉各位，本项目已经停止维护，为了不给您使用造成问题，请仅做参考使用，感谢各位支持\u003c/h1\u003e\n\n\n\u003cp align=\"center\"\u003e\u003ca href=\"https://github.com/icindy/wxParse\" target=\"_blank\"\u003e\u003cimg src=\"screenshoot/wxParse_logo.jpg\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp align=\"center\"\u003e\u003ca href=\"https://github.com/icindy/wxParse\" target=\"_blank\"\u003e\u003cimg src=\"screenshoot/weappmsg_qr.jpg\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003ch1 align=\"center\" style=\"margin-bottom: 20px;\"\u003ewxParse-微信小程序富文本解析组件\u003c/h1\u003e\n\u003ch2 align=\"center\"\u003e支持Html及markdown转wxml可视化\u003c/h2\u003e\n\u003cp align=\"center\"\u003e\u003ccode\u003e版本号:0.3\u003c/code\u003e\u003c/p\u003e\n\u003cp align=\"center\"\u003e来源: [微信小程序开发论坛-weappdev](https://weappdev.com)\u003c/p\u003e\n\u003cp align=\"center\"\u003e作用: 将Html/Markdown转换为微信小程序的可视化方案\u003c/p\u003e\n\n\n## 特性\n\n\n| 支持特性        | 实验功能           | ToDo  |\n| ------------- |-------------| -----|\n| - [x] HTML的大部分标签解析 | [x] 小表情emjio | [x] table标签 |\n| - [x] 内联style          | [x] a标签跳转   |               |\n| - [x] 标签Class          | [x] 动态添加    |               |\n| - [x] 图片自适应规则       |               |                |\n| - [x] 图片多图片预览      |                |               |\n| - [x] 模版层级可扩展性    |                |               |\n| - [x] 多数据循环方式      |                |  |\n| - [x] 内联style         |                |   |\n|         |                |   |\n\n## 相关截图\n\n![相关截图](screenshoot/screen.jpg)\n\n## 感谢\n\n[@stonewen](https://github.com/stonewen)| [@Daissmentii](https://github.com/Daissmentii)        | [@wuyanwen](https://github.com/wuyanwen)           | [@vcxiaohan](https://github.com/vcxiaohan)  |\n\n## 基本使用方法\n\n* 1. Copy文件夹`wxParse`\n```\n- wxParse/\n  -wxParse.js(必须存在)\n  -html2json.js(必须存在)\n  -htmlparser.js(必须存在)\n  -showdown.js(必须存在)\n  -wxDiscode.js(必须存在)\n  -wxParse.wxml(必须存在)\n  -wxParse.wxss(必须存在)\n  -emojis(可选)\n```\n\n* 2. 引入必要文件\n\n```\n//在使用的View中引入WxParse模块\nvar WxParse = require('../../wxParse/wxParse.js');\n```\n\n```\n//在使用的Wxss中引入WxParse.css,可以在app.wxss\n@import \"/wxParse/wxParse.wxss\";\n```\n\n* 3. 数据绑定\n```\nvar article = '\u003cdiv\u003e我是HTML代码\u003c/div\u003e';\n/**\n* WxParse.wxParse(bindName , type, data, target,imagePadding)\n* 1.bindName绑定的数据名(必填)\n* 2.type可以为html或者md(必填)\n* 3.data为传入的具体数据(必填)\n* 4.target为Page对象,一般为this(必填)\n* 5.imagePadding为当图片自适应是左右的单一padding(默认为0,可选)\n*/\nvar that = this;\nWxParse.wxParse('article', 'html', article, that, 5);\n```\n\n* 4. 模版引用\n```\n// 引入模板\n\u003cimport src=\"你的路径/wxParse/wxParse.wxml\"/\u003e\n//这里data中article为bindName\n\u003ctemplate is=\"wxParse\" data=\"{{wxParseData:article.nodes}}\"/\u003e\n```\n\n## 高级用法\n\n* 配置小表情emojis\n```\n/**\n* WxParse.emojisInit(reg,baseSrc,emojis)\n* 1.reg，如格式为[00]=\u003e赋值 reg='[]'\n* 2.baseSrc,为存储emojis的图片文件夹\n* 3.emojis,定义表情键值对\n*/\nWxParse.emojisInit('[]', \"/wxParse/emojis/\", {\n      \"00\": \"00.gif\",\n      \"01\": \"01.gif\",\n      \"02\": \"02.gif\",\n      \"03\": \"03.gif\",\n      \"04\": \"04.gif\",\n      \"05\": \"05.gif\",\n      \"06\": \"06.gif\",\n      \"07\": \"07.gif\",\n      \"08\": \"08.gif\",\n      \"09\": \"09.gif\",\n      \"09\": \"09.gif\",\n      \"10\": \"10.gif\",\n      \"11\": \"11.gif\",\n      \"12\": \"12.gif\",\n      \"13\": \"13.gif\",\n      \"14\": \"14.gif\",\n      \"15\": \"15.gif\",\n      \"16\": \"16.gif\",\n      \"17\": \"17.gif\",\n      \"18\": \"18.gif\",\n      \"19\": \"19.gif\",\n    });\n```\n\n* 多数据格式\n + 参见wiki[wxParse多数据循环使用方法](https://github.com/icindy/wxParse/wiki/wxParse%E5%A4%9A%E6%95%B0%E6%8D%AE%E5%BE%AA%E7%8E%AF%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95)\n\n## FAQ\n\n* 参见wiki[weParse常见问题FAQ](https://github.com/icindy/wxParse/wiki/wxParse%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98FAQ)\n\n## 二次开发\n\n* 基础数据格式\n\n```\nparsedata:{\n    view:{},//样式存储\n    nodes:{},//展示需要的存储节点\n    images:[],//存放图片对象数组\n    imageUrls:[],//存放图片url数组\n}\n\n```\n\n* 参见wiki[wxParse二次开发文档](https://github.com/icindy/wxParse/wiki/wxParse%E4%BA%8C%E6%AC%A1%E5%BC%80%E5%8F%91%E6%96%87%E6%A1%A3)\n\n## 相关文章\n\n* [wxDiscode－微信小程序特殊字符转义符转化工具类](http://weappdev.com/t/wxdiscode/203)\n* [微信小程序组件wxParse中的模版template使用 既然不能循环那就使用笨办法](http://weappdev.com/t/wxparse-template/192)\n* [微信小程序单图片的自适应计算](https://weappdev.com/t/topic/301)\n\n\n## 捐献\n\n* 参见wiki[捐献作者](https://github.com/icindy/wxParse/wiki/%E6%8D%90%E7%8C%AE%E4%BD%9C%E8%80%85)\n\n## 来源\n[微信小程序开发论坛](http://weappdev.com)\n垂直微信小程序开发交流社区\n\n可在网站扫描二维码进入我们的微信小程序群，也可以微信搜索\"weappmsg\"进入\"小码消息\"公众号\n![小码消息-weappmsg](screenshoot/weappmsg_qr.jpg)\n其他方式:合作qq群511389428\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficindy%2Fwxparse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficindy%2Fwxparse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficindy%2Fwxparse/lists"}