UNPKG

1.36 kBTypeScriptView Raw
1/**
2 * @license Copyright (c) 2003-2024, 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 paste-from-office/filters/space
7 */
8/**
9 * Replaces last space preceding elements closing tag with ` `. Such operation prevents spaces from being removed
10 * during further DOM/View processing (see especially {@link module:engine/view/domconverter~DomConverter#_processDomInlineNodes}).
11 * This method also takes into account Word specific `<o:p></o:p>` empty tags.
12 * Additionally multiline sequences of spaces and new lines between tags are removed (see #39 and #40).
13 *
14 * @param htmlString HTML string in which spacing should be normalized.
15 * @returns Input HTML with spaces normalized.
16 */
17export declare function normalizeSpacing(htmlString: string): string;
18/**
19 * Normalizes spacing in special Word `spacerun spans` (`<span style='mso-spacerun:yes'>\s+</span>`) by replacing
20 * all spaces with `&nbsp; ` pairs. This prevents spaces from being removed during further DOM/View processing
21 * (see especially {@link module:engine/view/domconverter~DomConverter#_processDomInlineNodes}).
22 *
23 * @param htmlDocument Native `Document` object in which spacing should be normalized.
24 */
25export declare function normalizeSpacerunSpans(htmlDocument: Document): void;