
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
custom-syntax-editor
Advanced tools
自定义语法编辑器
安装
npm install custom-syntax-editor
使用
import CustomEditor from "custom-syntax-editor";
const defaultCode = "";
const getCode = (code) => {
console.log(code);
}
<CustomEditor
defaultCode={defaultCode}
readOnly={false}
height={400}
theme="night"
activeLine={true}
fold={true}
keywords={keywords}
onChange={getCode}
/>
const keywords = [
// groovy 关键词
"as", "catch", "def", "enum", "for", "import", "new", "super", "throws", "while",
"assert", "class", "default", "extends", "goto", "in", "null", "switch", "trait", "break",
"const", "do", "false", "if", "instanceof", "package", "this", "true", "case", "continue", "else",
"finally", "implements", "interface", "return", "throw", "try",
// java 关键词
"abstract", "transient", "int", "strictfp", "synchronized", "boolean", "char", "do",
"final", "private", "short", "void", "double", "long", "protected", "static", "volatile",
"byte", "float", "native", "public",
// JDK 常用类
"System", "Runtime", "String", "StringBuffer", "StringBuilder", "Date", "DateFormat",
"SimpleDateFormat", "Calendar", "GregorianGalendar", "Math", "Integer", "Double", "Float",
"Boolean", "List", "HashMap", "Map", "ArrayList", "Arrays", "Random", "Iterator"
];

| 参数 | 类型 | 默认值 | 是否必填 | 说明 |
|---|---|---|---|---|
| defaultCode | string | "" | 非必填 | 初始化赋值 |
| readOnly | boolean | false | 非必填 | 设置只读 |
| height | number | 300 | 非必填 | 编辑器高度 |
| theme | string | "day" | 非必填 | 主题:"day"和"night" |
| activeLine | boolean | true | 非必填 | 当前行选中标识 |
| indentUnit | number | 4 | 非必填 | tab按几个空格缩进 |
| fold | boolean | true | 非必填 | 代码折叠 |
| keywords | array | [] | 非必填 | 自定义提示关键词 |
| onChange | function | 无 | 非必填 | 返回code |
| Ctrl+F | 键盘事件 | - | 非必填 | 自动格式化代码 |
MIT
FAQs
We found that custom-syntax-editor 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.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.