chore: 更新 marked 修复安全 alert (#3422)

This commit is contained in:
吴多益 2022-01-17 14:10:25 +08:00 committed by GitHub
parent 72f0f52c6c
commit b176fefe6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -154,7 +154,7 @@
"js-yaml": "^4.1.0",
"json5": "^2.2.0",
"lint-staged": "^12.1.4",
"marked": "^3.0.4",
"marked": ">=4.0.10",
"mkdirp": "^1.0.4",
"moment-timezone": "^0.5.33",
"path-to-regexp": "^6.2.0",

View File

@ -197,7 +197,9 @@ module.exports = function (content, file) {
}
);
content = marked(content).replace(/<p>\[\[(\d+)\]\]<\/p>/g, function (_, id) {
content = marked
.parse(content)
.replace(/<p>\[\[(\d+)\]\]<\/p>/g, function (_, id) {
return placeholder[id] || '';
});