
Research
/Security News
11 Malicious NuGet Tools Pose as Game Cheats to Drop a Windows Host-Surveillance Payload
11 malicious NuGet tools pose as game cheats to deploy Windows payloads, track hosts, and use Google Sheets for telemetry and control.
mini-program-parser
Advanced tools
🎈 轻量高效,体积仅5KB
📦 组件式封装,开箱即用
🔨 数据纯净,功能精简,更适合业务开发
npm install mini-program-parser
使用上述方法安装 mini-parser 并使用微信开发者工具进行 npm 构建
将库中component/mini-parser路径下的 mini-parser 组件拷贝至你的项目中
在页面的 json 文件中引入 mini-parser:
{
"component": true,
"usingComponents": {
"mini-parser": "{{your_path}}/mini-parser/index"
}
}
在 wxml 中使用 mini-parser:
<mini-parser html="{{htmlStr}}" config="{{config}}"></mini-parser>
| 属性 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| adaptive | 宽度自适应模式 | boolean | true |
| format | 属性格式化 | - | - |
| ignoredElement | 无需解析的元素类型 | string[] | defaultIgnoreElements |
宽度自适应模式
默认开启,当元素的宽度超过外层容器的宽度时,脚本会自动修改其宽度为容器宽度,并等比缩放其高度(如果有设置的话)
属性格式化
干涉解析结果的方法,可以对具体元素的属性解析行为进行干涉,新增/修改具体的属性/方法,举个例子:
format: {
img: {
/* 替换图片链接协议 */
src: (data) => data.replace("http", "https"),
/* 重写图片ID */
id: "overwrite-id",
/* 点击事件回调函数名 */
tapEvent: "handleTap"
},
text: {
/* 修改文本 */
content: (data) => data.replace("123", "abc"),
},
}
无需解析的元素类型
存在于该数组内的元素,在解析时不会解析其本身及其子元素,可在MiniParser.defaultIgnoreElements上追加元素或者替换为自己的忽略配置
ignoredElement:[...MiniParser.defaultIgnoreElements, 'iframe']
// or
ignoredElement:['iframe', 'table', '...']
FAQs
Mini Parser
The npm package mini-program-parser receives a total of 34 weekly downloads. As such, mini-program-parser popularity was classified as not popular.
We found that mini-program-parser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
11 malicious NuGet tools pose as game cheats to deploy Windows payloads, track hosts, and use Google Sheets for telemetry and control.

Research
/Security News
4 compromised asyncapi packages deliver miasma botnet loader on macOS, Linux and Windows.

Research
/Security News
A compromised jscrambler npm release added a malicious preinstall hook that runs hidden native binaries on Linux, macOS, and Windows.