У меня есть некоторые данные HTML в моей базе данных (информационный бюллетень), которые я хотел бы отобразить в Редакторе CK, однако по какой-то причине CKEditor "портит" формат этого HTML. Например, это часть исходных данных в db
<P style="FONT-SIZE: 2pt; MARGIN-BOTTOM: 0pt; MARGIN-TOP: 0pt">
<SPAN style="FONT-FAMILY: Verdana"> </SPAN>
</P>
<DIV style="TEXT-ALIGN: center">
<TABLE style="WIDTH: 408.8pt; BORDER-COLLAPSE: collapse; MARGIN-LEFT: auto; MARGIN-RIGHT: auto" cellSpacing=0 cellPadding=0>
<TBODY>
, и это то, как они отображаются внутри CKEditor: -
<p><span style="font-family:Verdana"> </span></p>
<div>
<table cellspacing="0" cellpadding="0" style="width:408.8pt" class=" cke_show_border">
<tbody>
, в результате чего текст не по центру, а также не в том же формате.
Так что мне было интересно, есть ли какие-либо настройки для CKEditor, который оставляет все как есть, не касаясь HTML?
Моя существующая конфигурация выглядит следующим образом: -
const GetDefaultConfig = {
toolbar: [
{ name: 'document', items: ['Save', 'NewPage', 'Preview', 'Print', '-', 'Templates'] },
{ name: 'clipboard', items: ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'] },
{ name: 'editing', items: ['Find', 'Replace', '-', 'SelectAll', 'Scayt'] },
{ name: 'forms', items: ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'] },
{ name: 'styles', items: ['Styles', 'Format', 'Font', 'FontSize'] },
{ name: 'colors', items: ['TextColor', 'BGColor'] },
{ name: 'tools', items: ['Maximize', 'ShowBlocks'] },
'/',
{ name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'CopyFormatting', 'RemoveFormat'] },
{ name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl', 'Language'] },
{ name: 'links', items: ['Link', 'Unlink', 'Anchor'] },
{ name: 'insert', items: ['Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe'] }
],
extraPlugins: 'font',
font_names: 'Arial;Comic Sans MS;Courier New;Georgia;Lucida Sans Unicode;Open Sans Regular;Tahoma;Times New Roman;Trebuchet MS;Verdana;',
language: 'en', //if ommitted the language of the users' browser is taken
removeDialogTabs: 'link:advanced;link:target;table:advanced', // Simplify the dialog windows.
format_tags: 'p;h1;h2;h3;h4', // Set the most common block elements.
fontSize_sizes: '8/8pt;9/9pt;10/10pt;11/11pt;12/12pt;14/14pt;16/16pt;18/18pt;20/20pt',
extraAllowedContent: 'div[id, contenteditable]',
enterMode: 2,
font_defaultLabel: 'Verdana',
fontSize_defaultLabel: '9',
disableNativeSpellChecker: false,
scayt_autoStartup: true,
// remove this line below for disabling browser spellcheck
removePlugins : 'scayt,menubutton,contextmenu,htmldataprocessor',
// HOW TO USE THE BROWSER SPELLCHECK
// To use the browser spellcheck, the user has to CTRL+RightClick on an empty space in the text area, so that he can choose the Language he
// wants to work with for checking the spelling of his text.
// To change a word that is wrong (red underlined), CTLR+RightClick on the actual word to get suggestions to change it to a different word
scayt_uiTabs : '0,1,0',
};
Я хотел бы иметь какую-то настройку, которая оставляет все теги HTML такими, какими они были изначально.
Возможно ли это?
Спасибо за вашу помощь и время