# ckeditor5-build **Repository Path**: xuyexu/ckeditor5-build ## Basic Information - **Project Name**: ckeditor5-build - **Description**: 基于ckeditor5做的扩展,功能有自定义上传视频,兼容office和wps的粘贴,文字混入图片粘贴 - **Primary Language**: JavaScript - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-02-05 - **Last Updated**: 2026-02-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: JavaScript, ckeditor5 ## README # ckeditor5-build #### 介绍 基于ckeditor5做的扩展,功能有自定义上传视频,兼容office和wps的粘贴,文字混入图片粘贴 版本为v38,刚好具有colorPicker的功能,且在39强制使用ems版本之前,兼容ems和cjs #### 软件架构 改过node_modules的一些文件,重新下载会覆盖掉,需要重新修改,不需要office的粘贴功能的话,不需要重新修改 具体为 1. node_modules\@ckeditor\ckeditor5-paste-from-office\src\filters\space.js ```js export function normalizeSpacerunSpans( htmlDocument ) { htmlDocument.querySelectorAll( 'span[style*=spacerun]' ).forEach( el => { // 针对 wps 添加的判断 // if (el.childNodes[ 0 ].data) { if (el.innerText.data) { const innerTextLength = el.innerText.length || 0; el.innerHTML = Array( innerTextLength + 1 ).join( '\u00A0 ' ).substr( 0, innerTextLength ); } }); } ``` 2. node_modules\@ckeditor\ckeditor5-paste-from-office\src\filters\image.js ```js function extractImageDataFromRtf(rtfData) { if (!rtfData) { return []; } let regexPictureHeader = /{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/; let regexPicture = new RegExp('(?:(' + regexPictureHeader.source + '))([\\da-fA-F\\s]+)\\}', 'g'); let images = rtfData.match(regexPicture); const result = []; // 针对 wps 添加的判断 if (!images) { regexPictureHeader = /{\\pict[\s\S]+?(\\pngblip-?\d+)?(\\wmetafile8-?\d+)?{\\\*\\blipuid\s?[\da-fA-F]+[\s}]*?/; regexPicture = new RegExp( '(?:(' + regexPictureHeader.source + '))([\\da-fA-F\\s]+)\\}', 'g' ); images = rtfData.match( regexPicture ); } if (images) { for (const image of images) { let imageType = false; if (image.includes('\\pngblip')) { imageType = 'image/png'; } else if (image.includes('\\jpegblip')) { imageType = 'image/jpeg'; } if (imageType) { result.push({ hex: image.replace(regexPictureHeader, '').replace(/[^\da-fA-F]/g, ''), type: imageType }); } } } return result; } ``` #### 安装教程 1. xxxx 2. xxxx 3. xxxx #### 使用说明 1. xxxx 2. xxxx 3. xxxx #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request #### 特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)