Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
braft-extensions
Advanced tools
npm install braft-extensions --save
# 或者
yarn add braft-extensions
需要分别import本模块包下面的各个模块,参见下方各模块的基本使用介绍
使用prismjs和draft-js-prism开发的一个代码高亮模块,能在编辑器中实现代码高亮编辑功能,内置html、js和css语言支持,可扩展更多语言
npm install prismjs draft-js-prism --save
# 或者
yarn add prismjs draft-js-prism
import 'braft-editor/dist/index.css'
import 'braft-extensions/dist/code-highlighter.css'
import BraftEditor from 'braft-editor'
import CodeHighlighter from 'braft-extensions/dist/code-highlighter'
const options = {
includeEditors: ['editor-id-1'], // 指定该模块对哪些BraftEditor生效,不传此属性则对所有BraftEditor有效
excludeEditors: ['editor-id-2'] // 指定该模块对哪些BraftEditor无效
}
BraftEditor.use(CodeHighlighter(options))
请访问PrismJs官网查看全部支持的语言
// 首先需要从prismjs中引入需要扩展的语言库
import 'prismjs/components/prism-java'
import 'prismjs/components/prism-php'
// 通过opitons.
const options = {
syntaxs: [
{
name: 'JavaScript',
syntax: 'javascript'
}, {
name: 'HTML',
syntax: 'html'
}, {
name: 'CSS',
syntax: 'css'
}, {
name: 'Java',
syntax: 'java',
}, {
name: 'PHP',
syntax: 'php'
}
]
}
BraftEditor.use(CodeHighlighter(options))
该功能将在后续版本中支持
使用react-color来替换编辑器自身的颜色选择模块,设置颜色更自由!
npm install react-color --save
# 或者
yarn add react-color
import 'braft-editor/dist/index.css'
import 'braft-extensions/dist/color-picker.css'
import BraftEditor from 'braft-editor'
import ColorPicker from 'braft-extensions/dist/color-picker'
const options = {
includeEditors: ['editor-id-1'], // 指定该模块对哪些BraftEditor生效,不传此属性则对所有BraftEditor有效
excludeEditors: ['editor-id-2'], // 指定该模块对哪些BraftEditor无效
theme: 'light', // 指定取色器样式主题,支持dark和light两种样式
}
BraftEditor.use(ColorPicker(options))
FAQs
Extensions for Braft Editor
The npm package braft-extensions receives a total of 462 weekly downloads. As such, braft-extensions popularity was classified as not popular.
We found that braft-extensions 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
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.