A
A
Anton2021-06-28 08:10:17
CKEditor
Anton, 2021-06-28 08:10:17

Ckeditor when copying a table, how to leave colspan and rowspan?

Hello.
When copying text or a form, I made sure that the styles are cleared, but how can I make sure that in the table, some styles are left, important ones that are responsible for lines, etc.
We are talking about colspan and rowspan , they are also cleaned.

My config:

//Ckeditor удаляет (чистит) javascript
config.protectedSource.push( /<script[\s\S]*?script>/g ); /* script tags */

// данная функция удаляет ссылки и стили при копирвоании с другого сайта.
config.forcePasteAsPlainText = false;

// настройки работают с модулем pastefromword форматирвоание текста если вставляем с ворда
config.pasteFromWordPromptCleanup = false;
config.pasteFromWordCleanupFile = false;
config.pasteFromWordRemoveFontStyles = true;
config.pasteFromWordNumberedHeadingToList = true;
config.pasteFromWordRemoveStyles = true;

// для контента
config.allowedContent = false;

// какие теги разрешает при вставке
  config.extraAllowedContent = 'table tr td th colgroup col b strong i u ul li';

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton, 2021-06-28
Websaytovsky @ws17

Found a solution: (tested, works)

config.extraAllowedContent = 'table; tr; td; th; colgroup; col; b; span; strong; i; u; ul; li; colspan; rowspan; *[colspan]; *[rowspan]';

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question