CKeditor config.indentOffset
作者:小编
日期:2025-06-16
点击:748
属于:技术动向
https://www.cnblogs.com/moerjiana/p/14780156.html
CKeditor 缩进是给<p>标签加‘margin-left: 40px;’
这样会导致整段文字都缩进,用户体验很不友好
查了网上的资料,把模板改成 'text-indent: 2em;' 就可以了。
1.打开ckeditor.js文件,使用ctrl+f进行搜索。
config.indentOffset||40 将40修改为2 config.indentUnit||"px" 将px修改为em u.getComputedStyle('direction') 将"margin-left":"margin-right"修改为"text-indent":"text-indent"
2.他说还要关闭过滤器,这个没试验,我反正是加上了
ckeditor/config.js 配置文件中修改
config.allowedContent = true;
清除缓存,完美解决
官方文档,改配置
https://docs-old.ckeditor.com/ckeditor_api/symbols/CKEDITOR.config.html
https://docs-old.ckeditor.com/ckeditor_api/symbols/CKEDITOR.config.html#.indentOffset
ckeditor/config.js 配置文件中修改
CKEDITOR.editorConfig = function( config ) { config.indentOffset = 2; config.indentUnit = 'em'; };
上一动态:按量付费机场
下一动态:暂无