Files
MetonaEditor/package.json
T
thzxx ddc650feeb fix(security): 属性级转义防注入 + 发布产物扩展名修复
- 链接/图片 href/src/alt/title 与代码块 language 属性改用属性级转义
  (浏览器环境 escapeHTML 不转义双引号,存在属性注入面)
- 修复 title 中反斜杠转义还原,引用链接 title 输出与行内一致
- 产物改用 .mjs/.cjs 扩展名(type:module 下 .js 被 Node 按 ESM 解析,
  require() 拿不到导出);exports 指向 dist 而非 src TS 源码
- 新增 .gitattributes 强制 LF,避免 Windows CRLF 污染 diff
- 配套测试:title/URL/alt/language 注入防护
2026-08-09 08:59:19 +08:00

86 lines
2.4 KiB
JSON

{
"name": "@metona-team/metona-editor",
"version": "0.2.5",
"description": "Type-safe, lightweight, zero-dependency Markdown Editor. Desktop-first. React-free. Single-file bundle.",
"type": "module",
"main": "dist/metona-editor.cjs",
"module": "dist/metona-editor.mjs",
"unpkg": "dist/metona-editor.min.js",
"jsdelivr": "dist/metona-editor.min.js",
"types": "dist/metona-editor.d.ts",
"exports": {
".": {
"types": "./dist/metona-editor.d.ts",
"import": "./dist/metona-editor.mjs",
"require": "./dist/metona-editor.cjs",
"default": "./dist/metona-editor.js"
},
"./package.json": "./package.json"
},
"files": [
"dist/",
"src/",
"README.md",
"LICENSE"
],
"scripts": {
"build": "rollup -c",
"dev": "rollup -c -w",
"test": "jest --coverage",
"test:watch": "jest --watch",
"lint": "eslint \"src/**/*.ts\"",
"lint:fix": "eslint \"src/**/*.ts\" --fix",
"format": "prettier --write src/",
"typecheck": "tsc --noEmit",
"bench": "node bench/benchmark.cjs",
"prepublishOnly": "npm run typecheck && npm test && npm run build"
},
"repository": {
"type": "git",
"url": "git+https://git.metona.cn/MetonaTeam/MetonaEditor.git"
},
"keywords": [
"markdown",
"editor",
"wysiwyg",
"ui",
"component",
"lightweight",
"zero-dependency",
"typescript"
],
"author": "thzxx",
"license": "MIT",
"bugs": {
"url": "https://git.metona.cn/MetonaTeam/MetonaEditor/issues"
},
"homepage": "https://git.metona.cn/MetonaTeam/MetonaEditor#readme",
"devDependencies": {
"@babel/core": "^7.22.0",
"@babel/plugin-transform-modules-commonjs": "^7.22.0",
"@babel/preset-env": "^7.22.0",
"@babel/preset-typescript": "^7.22.0",
"@rollup/plugin-commonjs": "^25.0.0",
"@rollup/plugin-node-resolve": "^15.0.0",
"@rollup/plugin-terser": "^0.4.0",
"@rollup/plugin-typescript": "^11.1.0",
"@types/jest": "^29.5.0",
"@typescript-eslint/eslint-plugin": "^8.65.0",
"@typescript-eslint/parser": "^8.65.0",
"babel-jest": "^29.5.0",
"eslint": "^8.40.0",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"prettier": "^2.8.0",
"rollup": "^3.20.0",
"rollup-plugin-dts": "^5.3.0",
"rollup-plugin-livereload": "^2.0.5",
"rollup-plugin-serve": "^2.0.1",
"tslib": "^2.6.0",
"typescript": "^5.0.0"
},
"engines": {
"node": ">=16.0.0"
}
}