CKEditor 图像宽度和高度作为 HTML 属性而不是内联样式

CKEditor image width and height as HTML attribute in stead of inline styling

我正在制作一个允许您上传图片的电子邮件程序网站。您可以调整图像的大小,但它将被写为内联样式:style="width: X; heigth: X".

当您想在 outlook 中预览电子邮件时,图像将以全宽和全高显示。

所以

<img src="x" style="width: x; heigth: x";>

我要

<img src="x" width="x" heigth="x">

我目前使用的是最新版本的CKEditor:V4.7.3

请参阅:https://docs.ckeditor.com/ckeditor4/docs/#!/guide/dev_acf-section-example%3A-disallow-inline-styles-and-use-attributes-instead。 link 准确描述了您要查找的内容。

请注意,要使其正常工作,需要启用高级内容过滤器 (ACF)。不熟悉的请看: