UNPKG

1 kBTypeScriptView Raw
1/**
2 * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4 */
5/**
6 * @module table/converters/table-cell-refresh-handler
7 */
8import type { EditingController, Model } from 'ckeditor5/src/engine';
9/**
10 * A table cell refresh handler which marks the table cell in the differ to have it re-rendered.
11 *
12 * Model `paragraph` inside a table cell can be rendered as `<span>` or `<p>`. It is rendered as `<span>` if this is the only block
13 * element in that table cell and it does not have any attributes. It is rendered as `<p>` otherwise.
14 *
15 * When table cell content changes, for example a second `paragraph` element is added, we need to ensure that the first `paragraph` is
16 * re-rendered so it changes from `<span>` to `<p>`. The easiest way to do it is to re-render the entire table cell.
17 */
18export default function tableCellRefreshHandler(model: Model, editing: EditingController): void;