Xin lỗi vì phản hồi muộn ... gần như quên về bài đăng này. Công việc của tôi trong khoảng thời gian đó là sao chép / dán mã từ một trang được hiển thị trong trình duyệt chưa từng được chỉnh sửa bởi DropEditor (nếu không html sẽ bị xóa khi bài viết được mở trong trình chỉnh sửa), sau đó đặt ký tự ẩn (mã alt 0173) ở giữa <em>các thẻ.</em>
Tuy nhiên, điều này là tẻ nhạt. Vì vậy, tôi đã tìm kiếm một giải pháp và tìm thấy bài đăng của riêng tôi ở đây. Tôi thật ngốc. Cảm ơn bạn đã phản hồi ... trong số HAI tệp cấu hình trong đường dẫn được chỉ định (config.json và config_p1.js), tệp javascript dường như là nơi hợp lệ để đặt mã, nhưng khi tôi làm vậy, trong hàm {} hoặc bên ngoài mỗi bên dưới, không có vị trí nào hoạt động. Một bài báo hoặc mô-đun html được mở để chỉnh sửa đã <em>bị xóa các thẻ</em> trống của chúng <em>.</em>
CKEDITOR.editorConfig = function( config ){
config.toolbar_1 = [
['Droppics'],['Dropfiles' ],['Droptables'],
'/',
{name: '00', items: ['Maximize','Undo','Redo','PasteFromWord']},
{name: '01', items: ['JustifyLeft','JustifyRight','JustifyCenter','JustifyBlock','Indent','Outdent','BulletedDropList','NumberedList','Blockquote']},
{name: '02', items: ['Bold','Italic','Underline','Subscript','Superscript']},
{name: '03', items: ['SpecialChar','Buttons','Templates','Image','Table','HorizontalRule']},
'/',
{name: '10', items: ['Source','Preview']},
{name: '11', items: ['TextColor','BGColor','Font','FontSize','GgFonts']},
{name: '12', items: ['JLink','Anchor','Unlink']},
{name: '13', items: ['Styles','Format']},
{name: '14', items: ['Find','Replace']},
];
config.removeButtons = 'About,Anchor';
config.format_tags = 'p;h1;h2;h3;pre';
config.removeDialogTabs = 'image:advanced;link:advanced'
config.allowedContent = true;
config.entities = false;
config.skin = 'material';
};
// OUTSIDE OF FUNCTION
CKEDITOR.dtd.$removeEmpty["em"] = false;
CKEDITOR.dtd.$removeEmpty["i"] = false;
CKEDITOR.editorConfig = function( config ){
config.toolbar_1 = [
['Droppics'],['Dropfiles' ],['Droptables'],
'/',
{name: '00', items: ['Maximize','Undo','Redo','PasteFromWord']},
{name: '01', items: ['JustifyLeft','JustifyRight','JustifyCenter','JustifyBlock','Indent','Outdent','BulletedDropList','NumberedList','Blockquote']},
{name: '02', items: ['Bold','Italic','Underline','Subscript','Superscript']},
{name: '03', items: ['SpecialChar','Buttons','Templates','Image','Table','HorizontalRule']},
'/',
{name: '10', items: ['Source','Preview']},
{name: '11', items: ['TextColor','BGColor','Font','FontSize','GgFonts']},
{name: '12', items: ['JLink','Anchor','Unlink']},
{name: '13', items: ['Styles','Format']},
{name: '14', items: ['Find','Replace']},
];
config.removeButtons = 'About,Anchor';
config.format_tags = 'p;h1;h2;h3;pre';
config.removeDialogTabs = 'image:advanced;link:advanced'
config.allowedContent = true;
config.entities = false;
config.skin = 'material';
// INSIDE FUNCTION
CKEDITOR.dtd.$removeEmpty["em"] = false;
CKEDITOR.dtd.$removeEmpty["i"] = false;
};
Vì vậy, tôi đang làm đúng và nếu vậy, bất kỳ ý kiến nào tại sao trình chỉnh sửa vẫn loại bỏ những thẻ trống này?