innoweb / silverstripe-tinymce-clearfloats
为CMS WYSIWYG编辑器添加清除浮动插件
3.1.0
2024-06-20 04:45 UTC
Requires
- silverstripe/cms: ^5
README
这是由 David Bammes 开发的 Wordpress插件 的 Silverstripe版本。
概述
在CMS中添加一个清除浮动插件到TinyMCE编辑器。
它使用编辑器中的图像来可视化清除元素,并将其替换为在网站上显示的 <br style="clear:both;" />
。
需求
- Silverstripe CMS 5.x
注意:此版本与Silverstripe 5兼容。
安装
使用composer安装模块
composer require innoweb/silverstripe-tinymce-clearfloats dev-master
或下载或git clone模块到您的webroot中的‘tinymce-clearfloats’目录。
然后运行dev/build。
配置
为了清理当清除的 <br>
是 <p>
元素中唯一的元素时添加的空白,请在您的editor.css文件中添加以下CSS
p > br[style="clear: both;"]:only-child:first-child {
content: ' ';
display: block;
margin: 0 0 -1.2em 0;
overflow: hidden;
}
您应该调整上述代码中的负边距以抵消在您的 <p>
元素上设置的边距。
许可
BSD 3-Clause License,请参阅 许可